I want to display all the lines starting from the nth line. Say, print the third line of a file and all the following lines until end of file. Is there a command for that?
To look at the last few lines of a file, use the tail command. tail works the same way as head: type tail and the filename to see the last 10 lines of that file, or type tail -number filename to see the last number lines of the file.
The tool wc is the "word counter" in UNIX and UNIX-like operating systems, but you can also use it to count lines in a file by adding the -l option. wc -l foo will count the number of lines in foo .
you can use tail
excerpt from the manpage:
-n, --lines=K output the last K lines, instead of the last 10; or use -n +K to output lines starting with the Kth
for example
tail -n +10 file
outputs the files content starting with the 10th line
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With