1) sed '2,4 s/x/z/g' ex1.txt 2) sed '2,4 ! s/x/z/g' ex1.txt 3) sed '/a/ s/x/z/g' ex1.txt 4) sed '/a/ ! s/x/z/g' ex1.txt 5) sed -n '2,4 s/x/z/gp' ex1.txt 6) sed -e '/NAME/, /AUTHOR/ ! d' -e '/AUTHOR/ d' ex4.txt 7) sed -e 's/.*Linux //g' -e 's/ command.*/:/g' ex2.txt 8) sed 's/ls$/the ls command/g' ex2.txt 9) sed '/here description/ s/\(.* .* .* .*\) \(.*\)/\1 the \2 command/g' ex2.txt 10) sed -e 's/(\(.*\))/[\1]/g' brackets.txt OR sed -e 's/(/[/g' -e 's/)/]/g' brackets.txt