sed code example
Example 1: sed
-i
sed -i 's/#mode/mode/' file.txt
http://sed.sourceforge.net/sed1line.txt
# substitute "foo" with "bar" ONLY for lines which contain "baz"
sed '/baz/s/foo/bar/g' file.sh
Example 2: sed
sed 's/foo/bar/'
http://sed.sourceforge.net/sed1line.txt
Example 3: sed line
Use d option at the end of sed replace definition for deleting line of matches.
sed -i "" "s/matching_pattern/d" file.txt