shell crlf to lf
You can use the following tools:
Type the following command to convert file called myfile.txt:$ dos2unix myfile.txt
However above command will not make a backup of original file myfile.txt. To make a backup of original file. The original file is renamed with the original filename and a .bak extension. Type the following command:$ dos2unix -b myfile.txt
Type the following command to convert file called myfile.txt:$ unix2dos myfile.txt
$ unix2dos -b myfile.txt
Type the following command:
tr -d '\r' < input.file > output.file |
Type the following command:
perl -pi -e 's/\r\n/\n/g' input.file |
Type the following command if you are using bash shell:$ sed 's/$'"/`echo \\\r`/" input.txt > output.txt
Note: sed version may not work under different UNIX/Linux variant,refer your local sed man page for more info.
If you are using BASH shell type the following command (press Ctrl-V then Ctrl-M to get pattern or special symbol)$ sed 's/^M$//' input.txt > output.txt
Note: sed version may not work under different UNIX/Linux variant, refer your local sed man page for more info.