Converting dos(windows) files to unix files

While using windows we get ^M characters in files that will get displayed when you open files on unix machines.

To remove such ^M characters,

Install dos2unix package using

sudo apt-get install sysutils

Convert individual file

dos2unix file_path

Run following command to convert recursively all the files inside directory.

find . -type f -exec dos2unix {} \;

sudo apt-get install sysutils

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.