dos2unix on Ubuntu and Debian

DOS text files traditionally have a carriage return and line feed character as newline character or symbol – mostly for historic reasons i think. Unix and Linux on the other hand have a line feed character as newline character in text files – and Macs have yet another “standard”.

From time to time I need to convert from one text file “standard” to another.

Red Hat-based Linux distributions are normally distributed with a small tool called dos2unix, which is able to do the conversion job very easy, but Debian-based Linux distributions like Debian itself and Ubuntu do not include the dos2unix tool by default.

The dos2unix tool i available in the Debian / Ubuntu package called tofrodos. To install the packages just type:

aptitude install tofrodos

Once you have the tofrodos package installed you are able to use the dos2unix command from the command line, like this:

dos2unix dosfile.txt

After running the command all the historic and crappy windows newlines are gone. ;)

VN:F [1.8.5_1061]
Rating: 0.0/10 (0 votes cast)

Related posts:

  1. Recursive convert dos newlines to unix ones with dos2unix
  2. Howto: Create your own Debian or Ubuntu package repository
  3. Howto: Install Ruby and Rails on Debian or Ubuntu
  4. Bash shortcuts tips and tricks
  5. Ubuntu Howto: Install Oracle
  6. Howto install Sun Java on Debian Sarge
  7. Howto Install Oracle on Debian
  8. How to mount bin / cue image files in Linux
  9. Howto: Write Debian Package Descriptions
  10. Howto: Install Windows Vista Fonts in Ubuntu

Popular Related Items »

1 Comment »

  1. Pages tagged "linux" said,

    April 30, 2008 @ 15:49

    [...] tagged linuxOwn a Wordpress blog? Make monetization easier with the WP Affiliate Pro plugin. dos2unix on Ubuntu and Debian saved by 5 others     zilchnerd bookmarked on 04/30/08 | [...]

RSS feed for comments on this post · TrackBack URI

Leave a Comment