SED command

~Saranya

sed ‘s/find/replace/’ filename

Find and replace a word in a file

Ex output:

sed ‘s/find/replace/1’ filename

It will find and replace in line 1

sed ‘1,3 s/find/replace/1’ filename

It will find and replace with the given range

Ex output:

sed ‘s/find/replace/g’ filename

Find and replace all the occurrences in a line.

sed ‘1,5 s/setof/set/g’ auto.tcsh |sed ‘10,15 s/e/0000/g’  |head -15

Replace the string within the given range.