Wednesday, January 14, 2009

How to get special lines data from file (Linux)

If you want to get file's head lines, you can use:
$ head FILE


If you want to get file's footer lines, you can use:
$ tail FILE


If you want to print some line that they not in first part or last part of file, you can use:
$ more +num10 FILE | head -n20


The above command print from line 10 to 30 (20 lines) of FILE

No comments:

Post a Comment