NAME
head - output the first part of files 輸出文件的第一部分
SYNOPSIS
head [OPTION]... [FILE]...head [選項]... [文件]...head命令在屏幕上顯示指定文件file的開頭若干行,行數由參數值來確定。顯示行數的默認值是10。
-c, --bytes=[-]NUM print the first NUM bytes of each file;with the leading '-', print all but the last NUM bytes of each file顯示每個文件的前N字節。若數字NUM前面帶有“-”,則分別顯示每個文件除最后NUM字節以外的所有內容。-n, --lines=[-]NUM print the first NUM lines instead of the first 10;with the leading '-', print all but the last NUM lines of each file顯示指定文件的前NUM行,而不是默認的10行。若數字NUM前面帶有“-”,則分別顯示每個文件除最后N行以外的所有內容。-q, --quiet, --silent 不顯示包含給定文件名的文件頭(標題)-v, --verbose 總是顯示包含給定文件名的文件頭(標題)-z, --zero-terminated 以 NUL 字符而非換行符作為行尾分隔符
示例
$ head -5 mfile (顯示文件mfile的前五行)
$ head -v mfile (顯示文件mfile的內容,并且給出文件名標題)
$ head -q mfile (顯示文件mfile的內容,但不列出文件名標題)