Changing file line endings from DOS to Unix

When a file comes with DOS line endings you can change it with this command

tr -d "\r" < file_dos_le > new_file_unix_le

In order to check what line ending it’s using the file use this command

file name_file_to_check

If the response contains “with CRLF line terminators” it’s a DOS line endings file

Advertisements

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