Contents / Previous / Next


sed -- The Stream Editor

sed allows editing of files non-interactively.
sed reads from stdin and writes to stdout,
it filters text in a pipeline.

The most common usage of sed is to replace
words in a stream with alternative words:
     sed -e 'COMMANDS'

Command to search-replace:

   `s/REGEXP/REPLACEMENT/FLAGS' : search and replace
                                  FLAGS: 'g'=apply to all matches


 cat file | sed -e 's/ search-regexp/replace-text/option' >resultfile

Example:
 
sed -e 's/e/E/g'