double space a file
sed G file
double space a file which already has some blank lines in it
sed '/^$/d;G'
triple space a file
sed 'G;G' file
undo double-spacing (assumes all even-numbered lines are always blank)
sed 'n;d' file
insert a blank line above every line which matches "regex"
sed '/regex/{x;p;x}'
insert a blank line below every line which matches "regex"
sed '/regex/G'
insert a blank line above and below every line which matches "regex"
sed '/regex/{x;p;x;G}'
number each line of a file (like grep -n "^")
sed = file | sed 'N;s/\n/:/'
number each line of a file (like cat -n)
sed = file | sed 'N;s/^/ /;s/\n/\t/'
number each line of file, but only print numbers if line is not blank
sed '/./=' file | sed '/./N;s/\n/ /'
count lines (like "wc -l")
sed -n '$='
delete leading whitespace (spaces, tabs) from front of each line
sed 's/^[ \t]*//'
delete trailing whitespace (spaces, tabs) from end of each line
sed 's/[ \t]*$//'
delete BOTH leading & trailing whitespace from each line
sed 's/^[ \t]//;s/[ \t]$//'