Changing a file's newlines to Unix newlines

Sometimes programs will put Windows newlines or Mac newlines into a file, causing a lot of problems with programs expecting Unix endlines. This Perl one liner, entered on the command line, will change those into Unix endlines:

perl -e 's/\r\n|\r/\n/g' FILES

If you want to keep a backup of the files you are changing, use this and the old files will have .orig put after them:

perl -p -i.orig -e 's/\r\n|\r/\n/g' FILES
XHTML 1.1 CSS 2 Sec 508