Perhaps the most powerful command in the editor is the 'g'
(global) command. This always precedes a second command
on the same command line; it selects those file lines
on which the second command is to be executed.
says: "Find all lines in the file which
contain the string "abc"; change the first
"def" on any such line into "ghi". The command
after the 'g' may be any command, of course.
Needless to say, the expressions after the 'g' may
include all the special characters.
Edit the file "towns" so that each line beginning
with "-" has " (county seat)" added at its end.
Rewrite the file and type "ready".
-morristown (county seat)