How Read a Specific Line in Unix?
Contents

How do I read a specific line in Unix?

If you’re already in vi, you can use the goto command. To do this, press Esc , type the line number, and then press Shift-g . If you press Esc and then Shift-g without specifying a line number, it will take you to the last line in the file.

How do I read a specific line in a file in Linux?

How to Display Specific Lines of a File in Linux Command Line

  1. Display specific lines using head and tail commands. Print a single specific line. Print specific range of lines.
  2. Use SED to display specific lines.
  3. Use AWK to print specific lines from a file.
Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest