s/xx/yy/g Substitute on all lines (all occurrences)
/BSD/d Delete lines containing BSD
/^BEGIN/,/^END/p Print all lines between lines that begin with
BEGIN and END, inclusive
/SAVE/!d Delete any line that doesn't contain SAVE
/BEGIN/,/END/!s/xx/yy/g Substitute on all lines, except between BEGIN and END
1~2 p Print all odd numbered lines
2~3 d Delete every third line beginning with the second.