2

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?

1
  • Most text editors in Windows can handle Unix line breaks, notepad.exe being the notable exception (even Wordpad can).
    – Daniel Beck
    Jan 7, 2013 at 0:14

2 Answers 2

5

On Ubuntu:

$ apt-get install dos2unix
$ unix2dos file.txt

On Windows:

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .