How to display all the lines from the nth line of a file in unix

user3905438 picture user3905438 · Sep 5, 2014 · Viewed 51.1k times · Source

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?

Answer

Nikolaus Gradwohl picture Nikolaus Gradwohl · Sep 5, 2014

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