Fixes the line-endings of the specified file(s). The line-ending used can be specified via the command-line.
fixeol normalizes line endings for one or more files, directories, or wildcard patterns.
Click here for the latest release.
Examples
fixeol --recursive --eol crlf *.css *.js
fixeol --eol lf --encoding utf8 README.md
fixeol --dry-run --recursive --eol lf --encoding utf8 "*.cs"
fixeol /r /backup src\*.cs
fixeol --encoding utf8 --eol crlf -r *.code-workspace *.cs *.csproj *.bat -exclude specific-file.bat
Usage
fixeol [options] "file-patterns" ["file-patterns"] [...]
File patterns can be specific files, directories, or wildcards. Use --recursive, -r, or -s to apply patterns to subdirectories.
Includes are optional by default: missing literal files or directories, patterns whose
parent directory is missing, and wildcards with no matches are skipped. Existing
matches are still processed. If no files match (or all matches are excluded), fixeol
does nothing and returns exit code 0. This also applies to --dry-run.
For example, a shared normalization task can include Makefile even in repositories
that do not have one:
fixeol --recursive --eol lf --encoding utf8 Makefile "*.cs" "*.csproj"
At least one include argument is still required. Invalid arguments or paths and real
directory enumeration, access, read, or write failures remain errors with nonzero
exit codes.
Unknown options are errors; prefix a file name beginning with - with ./
(for example, ./-notes.txt) so it is treated as a path.
Options
--eol [os|crlf|cr|lf|\r\n|\r|\n]chooses the output line ending. The default isos.--encodingchooses the output encoding. Accepted values areos,default,ascii,ansi,utf32,utf-32,utf32bom,utf-32-bom,utf7,utf-7,utf8,utf-8,utf8bom,utf-8-bom,unicode,utf16,utf-16,windows1252,windows-1252,win1252, andwin-1252. The default isos; hyphens are optional.--recursive,-r,-sscans subdirectories.--exclude [pattern]skips matching file names or paths. Repeat it for multiple excludes; excludes win over include patterns.--backupkeeps the original file as.bak.--dry-runprints only the paths of files whose contents would change, one per line, without writing files or creating, replacing, or deleting backups (even with--backup). It checks line endings, the final newline, encoding, and BOM changes using the same conversion as a normal run. It honors recursion and exclusions, suppresses progress and verbose output, and returns exit code 0 on success whether or not changes are found.--progressprints per-file progress.--verboseprints additional processing details.--pausewaits for a key before exiting.--help,-?,-h, orhelpprints usage.-vprints the version;--versionprints full app metadata.
On Windows, options can use -, --, or / prefixes. Use ! to turn off a boolean option from the command line, for example --!verbose.
Environment Variables
Command-line arguments override environment variables. Use semicolons to separate multiple fixeol_exclude patterns.
fixeol_eolfixeol_encodingfixeol_recursivefixeol_excludefixeol_backupfixeol_progressfixeol_verbosefixeol_pause
