Alvin Alvin - 4 months ago 34
Linux Question

Get the line count from 2nd line of the file

How do I get the line count of a file from the 2nd line of the file, as the first line is header?

wc -l filename

Is there a way to set some condition into it?


Use the tail command:

tail -n +2 file | wc -l

-n +2 would print the file starting from line 2