Quick Table of Contents
- Using back references to append text to each line
- Delete all occurrences of 4 consecutive digits
- Switch or swap 2 words around
- Links
SED examples
1. Using back references to append text to each line
To appending the string "EXTRA TEXT" to each line
sed -e 's/\(.*\)/\1EXTRA TEXT/'
Note the backslash before the brackets.
\1 is the back reference to the first group (only 1 group in this case, which has matched the whole line.

