ACM@UIUC TIL logo ACM@UIUC TIL

This is a collection of snipits of common tasks

Remove everything before the last space

sed 's/.* //'

Remove last character from every line

sed 's/.$//' file > file.nolast

Remove substring from the end of very line

sed 's/[SUBSTRING]$//' file > file.noss