How to tail all lines except first row
LinuxBashLinux Problem Overview
For example, I have a file
1
2
3
then I want to output from 2nd row to tail
How can I do it in linux
Linux Solutions
Solution 1 - Linux
tail -n+2 my_file
will output all the lines in myfile
starting with line 2. (-n2
would show you the last two lines.)
tail
has lots more options. Type man tail
for complete documentation.
Solution 2 - Linux
shorter with
$ sed 1d filename
or with awk
$ awk 'NR>1' filename