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

Advertisements

About sandipransing

Web Developer #ruby #rails #JS
This entry was posted in General and tagged , . Bookmark the permalink.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s