#
Head --help
Usage: head [options] ... [File] ...
Displays the first 10 lines of each specified file to standard output.
if more than one file is specified, the filename is given as the file header before each segment of output.
If you do not specify a file, or if the file is "-", the data is read from standard input.
parameters that must be used for long options are also required for short options.
-C, --bytes=[-]k Displays the first K-byte content of each file, and
if the "-" parameter is attached, displays all remaining content except the last K-byte data for each file-
N,--lines=[-]k Displays the contents of the first k lines of each file, and
if the "-" argument is attached, all remaining contents are displayed except for the last K line of each file-
Q,--quiet,--silent does not display the file header-V with the given file name.
--verbose always displays header--help with the given file
name Display this Help information and exit
--version display version information and exit
K with multiplication:
b 1000, KB, K 1024, MB 1000*1000, M 1024*1024,
GB 1000*1000*1000, G 1024*1024*1024, for T, P, E, Z, Y are equally applicable.
Sample
Original file
# cat t.txt
Apple
Banana
Cherry
durian
Fig
Grape
Haw JuJube Kumquat
Lemon
Mango
Orange
Peach
//Statistics First, 13 lines 13 words 94 bytes
# cat T.txt |WC
13
//default display 10 line # head
t.txt
Apple
Banana
Cherry
Durian
Fig
Grape
Haw
jujube
Kumquat
Lemon
//Display only the first 7 bytes (including carriage return line)
# head-c7 t.txt
Apple
/ /Show only the first 2 lines
# head-n2 t.txt
Apple
Banana
//only displays content other than the last 87 bytes (that is, first 7 bytes)
# head-c-87 T.txt
Apple
//only displays content other than the last 10 lines (that is, top 3 lines)
# head-n-10 t.txt
Apple
Banana
Cherry