dos2unix
TLDR
Convert file line endings
$ dos2unix [path/to/file]
Create copy with Unix line endings$ dos2unix -n [path/to/file] [path/to/new_file]
Display file information$ dos2unix -i [path/to/file]
Handle BOM (keep/add/remove)$ dos2unix --[keep-bom|add-bom|remove-bom] [path/to/file]
SYNOPSIS
dos2unix [options] [file...]
DESCRIPTION
dos2unix converts text files from DOS/Windows format (CRLF line endings) to Unix format (LF line endings). It modifies files in place by default.
Essential when working with files created on Windows or transferred between operating systems.
PARAMETERS
-n, --newfile in out
Write to new file instead of in-place-i, --info [flags]
Display file information--keep-bom
Keep Byte Order Mark--add-bom
Add Byte Order Mark--remove-bom
Remove Byte Order Mark-c, --convmode mode
Conversion mode (ascii, 7bit, iso)
CAVEATS
Modifies files in place by default; use -n to preserve original. Binary files may be corrupted. Check with -i before converting.


