Technote (FAQ)
Question
Why do I see "extra" carriage return/line feed information on files edited in Windows when they are viewed in UNIX?
Answer
Lines in text files that have been created or updated under DOS or Windows end with:
\r \n
Whereas lines in text files created or updated under UNIX end with only:
\n
\r = return (CR) octal 015
\n = new-line (NL) octal 012
If you want a file created under DOS or Windows to look good under UNIX, you can run the following command. Note: This will delete *all* the CRs from the file.
tr -d "\r" < input_dos_or_win_file > output_unix_file
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.