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

Posted on In QA

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

Use this script with sed:

cat your_file | sed 's/[[:blank:]]+$//g'

Leave a Reply

Your email address will not be published.