s:/usr/mail:/usr2/mail:
Note that the delimiter appears three times and is required after the
replacement. Regardless of which delimiter you use, if it does appear
in the search pattern or the replacement, put a backslash
(\) before it to escape it.
If you don't know what characters the search pattern
might have (in a shell program that handles any kind of input, for
instance), the safest choice for the delimiter can be a control
character.
You can use any delimiter for a pattern address (not just a slash).
Put a backslash before the first delimiter. For example, to delete
all lines containing /usr/mail, using a colon
(:) as the delimiter:
\:/usr/mail:d
--DD and JP
 |  |  |
34.7. One Thing at a Time |  | 34.9. Newlines in a sed Replacement |