SyntaxFix
Write A Post
Hire A Developer
Questions
sed -i 's/[[:blank:]]\{1,\}$//' YourFile
[:blank:] is for space, tab mainly and {1,} to exclude 'no space at the end' of the substitution process (no big significant impact if line are short and file are small)