What is the command to specify the line in the Linux view file?

  

When you are operating in Linux, sometimes you need to check the contents of the specified line number of the file. This requires the use of commands. The following small series will introduce you to the command to view the specified line of files under Linux.

In the Linux system, to find the content containing a keyword from the file, you can pass cat filename |  Grep “xxx” and similar commands are implemented, but if you look at the contents of the specified line number in the file, you need the following command to achieve.

1, through the command cat filename |  The grep -n “” command prints out the starting and ending line numbers to look for.

2, using sed -n & lsquo; x, yp & rsquo; filename command to print out the contents between the starting and ending lines (including the starting and ending lines).

Linux command above to view the file specified line is introduced, you can easily use this command to find what you want to see, you learn it?

Copyright © Windows knowledge All Rights Reserved