Home

Advertisement

Customize

Shantanu Oak - November 20th, 2008

Nov. 20th, 2008

02:38 pm - Remove junk in Linux

Sometimes you'll end up with carriage returns on each line in a file originally created on a DOS/Windows system, or filenames with spaces, tab, or other control characters in them, but you can't see them typically.
The cat command provides three useful options -v, -e, and -t that will let you understand these invisible characters
-v (displays non-printing characters)
-e (prints a "$" at the end of each line to indicate a NL character)
-t (prints "^I" for each Tab in the file)
cat -vet filename |more

Tags:
Current Mood: nerdy
Previous day (Calendar) Next day