Remove trailing spaces at the end of each line in a file

How to remove trailing spaces at the end of each line in a file on Linux?

asked Jan 8, 2014 by anonymous

1 Answer

 
Best answer

Use this script with sed:

cat your_file | sed 's/[[:blank:]]\+$//g'
answered Jan 8, 2014 by anonymous

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...