8d | Delete 8th line of input. |
/^$/d | Delete all blank lines. |
1,/^$/d | Delete from beginning of input up to, and including
first blank line. |
/Jones/p | Print only lines containing "Jones" (with
-n option). |
s/Windows/Linux/ | Substitute "Linux" for first instance
of "Windows" found in each input line. |
s/BSOD/stability/g | Substitute "stability" for every instance
of "BSOD" found in each input line. |
s/ *$// | Delete all spaces at the end of every line. |
s/00*/0/g | Compress all consecutive sequences of zeroes into
a single zero. |
echo "Working on it." | sed -e '1i How far are you along?' | Prints "How far are you along?" as first line,
"Working on it" as second. |
5i 'Linux is great.' file.txt | Inserts 'Linux is great.' at line 5 of the file
file.txt. |
/GUI/d | Delete all lines containing "GUI". |
s/GUI//g | Delete all instances of "GUI", leaving the
remainder of each line intact. |