How to use sed command to remove lines from a file which match a particular pattern.
sed ‘//d’ file-name > tmp
This command will delete all the lines from the file which match the pattern and then store the contents in the ‘tmp’ file.
How to use sed command to substitute strings which match a pattern and then replace it with another string?
sed -e ‘s///’
This command is to match a string and replace it with another string. The new contents of the will be stored in
How to use a pattern matched in sed command also in the replaced string?
Use & to substitute the matched string.