#Using dos2unix Replacing the original file:
dos2unix filename
Creating a .bak copy of the original:
dos2unix -b filename
#Using tr command
tr -d '\r' < input.file > output.file
#Using Perl One Liner
perl -pi -e 's/\r\n/\n/g' input.file
#Using bash shell:
sed 's/$'"/`echo \\\r`/" input.txt > output.txt
#Using sed command
sed 's/^M$//' input.txt > output.txt