Dos2Unix type conversion on Mac OS

August 23, 2009

Converting the line ending of a file on your Mac from dos or windows format to Mac format is as simple as entering the following command in an iTerm terminal window.

tr '\r' '\n' file-with-mac-newline.txt

I spent quite a while looking for a dos2mac type program, expecting to find dos2unix for the mac, when I came across the tr command that does just what I wanted.


Follow

Get every new post delivered to your Inbox.