# Inserting a text on a specified line number ex. insert a text in line number 8 sed command “8i”

-e '8i\# PC-Check 7\.03 with net support'

special characters like # and . should have a \ suffix.

# Insert a blank line on line number

-e '8i\\`echo -e '\n\r'`'

# to append at end of the file: sed command: $a

-e '\$a#HQ to local DVR'

# search and replace, ^ - match all words beginning the word specified and replace the matching word,

-e 's/^DNAT/#DNAT/g'

# search and replace whole line: .* - match all lines containing the word being search and replace the whole line.

-e 's/.*DNAT.*/#DNAT/g'