Monday, February 23, 2009

Convert line break between Linux and Windows

If you are both Linux's and Window's user then you must know that Linux and Windows uses different line breaks.

So If you type something in Linux and open in Window or vice versa then your line will not break properly.

However you can easily convert between them. You can either use powerful sed or with a simple program tofrodos.

To convert Linux line break to Windows type:

unix2dos filename.txt

To convert Windows line break to Linux type:

dos2unix filename.txt
Use -b option if you want to backup the file before changes are made.

Use it with find command to perform changes in multiple files.

0 comments:

Post a Comment

Comments are moderated. No spam please.