sed—stream editor (seeChapter 4)

sed [-n] [-V] [--quiet] [--silent] [--version] [--help] [-e script]
    [--expresion=script] [-f script-file] [--file=script-file]
    [script-if-no-other-script] [file…]

sed copies the named filename (standard input default) to the standard output, edited according to a script of command. Does not change the original file. (Read about sed in Chapter 4.) sed 's ability to filter text in a pipeline distinguishes it from other editors.

Example A.51.
1  sed 's/Elizabeth/Lizzy/g' file
2  sed '/Dork/d' file
3  sed -n '15,20p' file

Explanation

  1. Substitutes all occurrences of Elizabeth with Lizzy in file and displays on the terminal screen.

  2. Removes all lines containing Dork and prints the remaining lines on the screen.

  3. Prints only lines 15 through 20.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.18.198