sed—streamlined editor
sed [–n] [–e script] [–f sfilename] [filename ...]
sed copies the named filename (standard input default) to the standard output, edited according to a script or command. Does not change the original file.
Example A.49.
1 sed 's/Elizabeth/Lizzy/g' file
2 sed '/Dork/d' file
3 sed -n '15,20p' file
EXPLANATION
Substitute all occurrences of Elizabeth with Lizzy in file and display on the terminal screen. Remove all lines containing Dork and print the remaining lines on the screen. Print only lines 15 through 20.
|