User Tools

Site Tools


sed:delete:delete_trailing_whitespace_spaces_tabs_from_end_of_each_line

This is an old revision of the document!


SED - Delete - Delete trailing whitespace (spaces, tabs) from end of each line

sed 's/[ \t]*$//' 

NOTE: The expression '\t' is used to indicate a tab character (0x09) in the scripts.

Some versions of sed do not recognize the '\t' abbreviation, so when typing these scripts from the command line, you should press the TAB key instead.

'\t' is supported as a regular expression.


Example

Running that command again this file:

testfile
aaa 
bbb
ccc

returns:

testfile
aaa
bbb
ccc
sed/delete/delete_trailing_whitespace_spaces_tabs_from_end_of_each_line.1597576063.txt.gz · Last modified: 2020/08/16 11:07 by 192.168.1.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki