Here is the brief introduction of the Super
sedstand for Stream EDitor and it being based on the
ededitor, it borrows most of the commands from the
ed. It was developed by Lee E. McMahon of Bell Labs.
sedoffers large range of text transformations that include printing lines, deleting lines, editing line in-place, search and replace, appending and inserting lines, etc.
sedis useful whenever you need to perform common editing operations on multiple lines without using 'vi' editor.
sedis executed on an input file or on the contents from stdin,
sedreads the file line-by-line and after removing the trailing newline, places it in the "Pattern space", where the commands are executed on them after conditions (as in case of regex matching) are verified, and then printed on the stdout.
Printing Lines from a File using sed
Before we start, just remember two points:
sed"p" command lets us print specific lines based on the line number or regex provided.
-nwill suppress automatic printing of pattern buffer/space. So, we would want to use this option. (Explained in later section)
Read more at YourOwnLinux