How to print file head in linux


 description

View the first 12 lines of the test.txt file in linux

 command

head -v -n 12 test.txt 

 parameter

head : Print the first 10 lines of each FILE to standard output.
-v, --verbose :  always print headers giving file names
-n, --lines=[-]NUM :  Specify the number of print lines

 result

==> test.txt <==
1
2
3
4
5
6
7
8
9
10
11

I hope to help every developer quickly find the commands they need. Of course, you can also add your own commonly used commands for easy searching.