Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Another handy command you can use is sed, which lets you make multiple changes to files, without ever opening an editor. For example, as a new Webmaster, you might use sed to change all occurrences of the previous Webmaster's e-mail address to your own, as shown in our example below. As we'll show in this section, you can use sed to make global changes within documents.
To make global changes with sed:
sed /oldaddr@raycomm.com → /newaddr@raycomm.com/g address.htm → > address.htm
/the text you want to replace (/oldaddr@raycomm.com)
A slash (/)
The replacement text (newaddr@raycomm.com)
Another /
g, which tells UNIX to apply the change globally. (If you omit the g, only the first occurrence on each line will be changed.)
The name of the file in which the changes should be made (address.htm).