Convert DOS and Windows line breaks to Unix line breaks
These one liners will convert a file with DOS (or windows) line breaks to a file with Unix line breaks
DOS/Windows to Unix:
tr -d '\15\32' < dosfile.txt > unixfile.txt
Under Solaris this will work as well:
dos2unix dosfile.txt unixfile.txt











Hollister said on October 1, 2010
That doesn’t work either…it just deletes all the “R” characters.
You need to escape the CR and make it global. This works better:
sed -i ’s/rn/n/g’ file.txt