Text: sed cookbook
Here is a selection of useful sed commands/scripts. If you are looking more for guidance on using sed try this.
Quick refresher on running sed
sed [-n] -e 'commands' inputfiles
sed [-n] -f scriptfile inputfiles
Use the -e
flag to include the commands as part of the command and the -f
flag to load the commands from a script file.
The -n
flag can also be used to restrict output to only lines specified with
the p command or p flag.
Remove empty lines
/^$/d