Fetching lines partially using command line
Published on July 5, 2010 by
To see some part of a text file, use the following methods:
1- To get top 20 lines of a file header, use:
$ head -n20 FILE
2- To get 30 line of bottom of a file, use:
$ tail -n30 FILE
3- If you want to print some lines that they are not in the first part or in the last part of a file, you can use:
$ more +num10 FILE | head -n20
The previous command print from line 10 to 30 (20 lines) of FILE.
Tags: Command Line, Linux
Posted in Linux
No Comments