Text manipulation with sed

Larry W. Richardson · Linux journal · 2005

The filter sed can process text from standard input and write its results to standard output. The input can be redirected from a file, and the output also can be redirected to a file using your shell's redirection capabilities. It has hundreds of uses, and once you learn sed, you really would miss it if you lost it. sed can append lines, remove lines, change lines, rearrange lines, substitute text strings and more. Using sed, you can write simple scripts that can become powerful text manipulating commands. sed can use regular expressions to define what processing will occur on lines of text and which lines it processes. If you have never seen or used regular expressions before, you may want to become familiar with the basic syntax of regular expressions. In this article, we use a few regular expressions to make sed do some simple text processing.

Read the paper · More papers on PaperTik