Convert Dos to Unix

From: COMMAND LINE KUNG FU: PaulDotCom, Ed Skoudis, Hal Pomeranz, byte_bucket

Okay, so we’ll start simple here at Command Line Kung Fu. I think many of us run into the problem where we get those funny Windows characters in our files (^M). These are of course Windows line breaks. The simple solution (which should work on OS X and Linux):

tr ‘r’ ‘n’ < file.txt > file.txt

I just had to do this on a file that someone shared with me. Next maybe we’ll look at how I chopped up and hacked that file with grep and cut :)

Feel free to share:
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Furl
  • LinkedIn
  • StumbleUpon
  • Technorati
  • TwitThis
  • Digg
  • MySpace
  • Ping.fm
  • Slashdot

Filed Under: Tech

Tags:

About the Author: I am the I.T. Director and Information Security Officer for an ecommerce / production company. I'm also a graphic designer; musician; martial arts instructor; pilot and all around creative genius.

RSSComments (0)

Trackback URL

Leave a Reply

You must be logged in to post a comment.