sed

# remove third line
sed -i 3d

# insert line on beginning of a file
sed -i '1i MY_TEXT'

# String replace with sed
sed -i 's|STRING_FROM|STRING_TO|g' FILE
sed -i 's|[#]*param=[yes|no]*|param=yes|g' FILE

# add line to a file
sed -i '13i\YOUR_TEXT' FILE

# add line before last line
sed -i '$i test_line' /path/to/file

# search block
sed -n '/FOO/,/BAR/p' /path/to/file

# remove digits
echo $FOO | sed 's/[^0-9]*//g'

# remove blanks
cat FILE | sed 's/ */ /g'
# remove blanks and tabs
cat FILE | sed "s/

[ ]*/ /g"
 
# write to file
sed 's/foot/bar/;w file'
 
# remove leading blank
sed "s/^[ ]*//"
 
# cat from to
sed -n '/^START/,/^END/p' /tmp/xx