LinuxSysAdmin

Things I don't want to look for twice..

Monthly Archives: June 2013

remove trailing whitespace from all lines in a file using sed

I needed that because when I copy & pasted something while pressing Alt, the trailing whitespace was also copied. So to get rid of that, just run:

sed -i ‘s/[ \t]*$//g’ filename

All done in a second.

Advertisements