head命令

head:显示文件的从开始到指定行

用法:

Usage: head [OPTION]... [FILE]...
Print the first 10 lines of each FILE to standard output.——默认打印前10行
With more than one FILE, precede each with a header giving the file name.
With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.
-c, --bytes=[-]N print the first N bytes of each file;——打印前N个字符
with the leading `-', print all but the last
N bytes of each file
-n, --lines=[-]N print the first N lines instead of the first 10;——打印前N行
with the leading `-', print all but the last
N lines of each file
-q, --quiet, --silent never print headers giving file names
-v, --verbose always print headers giving file names
--help display this help and exit
--version output version information and exit

N may have a multiplier suffix: b 512, k 1024, m 1024*1024.

Report bugs to <bug-coreutils@gnu.org>.

原文地址:https://www.cnblogs.com/wbz-blogs/p/8619036.html