Dead Simple dos2unix “command”

The web is floating over (well, .. nearly) with various one-liners that can convert newlines of a text file from the dos/windows way to the unix way. These use tools like sed, tr, perl, .. to do the trick, and here is another one – using vim:

$ vi your-dos-newline-file.txt
:set fileformat=unix
:wq
and you are done. And I am pretty sure this can be one-lined too, with the proper v(h)im-sical command tooling :-)

October 10, 2011 В· polesen В· No Comments
Posted in: Operating Systems, Tools

Leave a Reply