Linux command
eol 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Report line-ending style
eol [file.txt]
Convert to Unix
eol -c LF [file.txt]
Convert to Windows
eol -c CRLF [file.txt]
Convert to the platform's native
eol -c native [file.txt]
Recursively find files
eol -r -f dos [path]
Skip a directory
eol -r -x .git [path]
说明
eol is a command-line script (and Python module) for inspecting and converting end-of-line characters in text files. With no action flag it reports each file's detected EOL style (Unix/LF, Windows/CRLF, Mac Classic/CR, mixed, or none). Use `-c` to rewrite files to a chosen style, or `-f` to locate files that already use a particular style. Directory traversal is off unless `-r` is given. Binary files are detected and skipped by default.
参数
- -c, --convert _NAME_
- Convert files to the given EOL style. _NAME_ is one of LF, CRLF, CR, NATIVE (aliases: unix, dos/windows, mac, native — case-insensitive).
- -f, --find _NAME_
- List files that have the given EOL style. Accepts the same names as `-c` plus NONE and MIXED.
- -r, --recursive
- Recurse into directories (off by default).
- -x, --skip _PATTERN_
- Skip files or directories matching _PATTERN_ (e.g. `.git`, `*.pyc`).
- -v, --verbose
- Show debug-level output.
- -q, --quiet
- Only show warnings and errors.
- --test
- Run the tool's self-tests and exit.
- -h, --help
- Show help.
FAQ
What is the eol command used for?
eol is a command-line script (and Python module) for inspecting and converting end-of-line characters in text files. With no action flag it reports each file's detected EOL style (Unix/LF, Windows/CRLF, Mac Classic/CR, mixed, or none). Use `-c` to rewrite files to a chosen style, or `-f` to locate files that already use a particular style. Directory traversal is off unless `-r` is given. Binary files are detected and skipped by default.
How do I run a basic eol example?
Run `eol [file.txt]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -c, --convert _NAME_ do in eol?
Convert files to the given EOL style. _NAME_ is one of LF, CRLF, CR, NATIVE (aliases: unix, dos/windows, mac, native — case-insensitive).