Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a bunch of text files created in Ubuntu and when I access them on a Windows machine using DropBox they are not properly formatted because of the Line Ending difference between Unix/Linux and Windows.

After changing the Line Ending from Unix/Linux to Windows, the text file was rendered properly in both Windows and Ubuntu.

How to convert the Line Ending from terminal to automate the conversion?

share|improve this question
Most text editors in Windows can handle Unix line breaks, notepad.exe being the notable exception (even Wordpad can). – Daniel Beck Jan 7 '13 at 0:14

On Ubuntu:

$ apt-get install dos2unix
$ unix2dos file.txt

On Windows:

share|improve this answer

I would suggest the tofrodos package. Converts neatly either way, with todos and fromdos. Available only on the Ubuntu side, I should note.

On the Windows side, my memory is that Wordpad (unlike Notepad) will in fact display files with *nix line endings correctly, which should be a help for viewing files that haven't been converted.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.