bash shell笔记整理——head命令

作用

我直接搬运官方英文了,这英文真的简单直白了,我英语辣鸡...毕竟我学历不行,觉得翻译不好就直接自己来吧。。

Print the first 10 lines of each FILE to standard output.
With more than one FILE, precede each with a header giving the file name.
With no FILE, or when FILE is -, read standard input.

打印给定文件的前10行内容到标准输出,如果有多个文件就会再文件前面输出文件名,没有文件或者是-则读取标准输入(这个玩意还是简单的....)

语法

head [OPTIONS..] [FILE..]

*选项* *使用说明*
-NUM
-n NUM
显示n行内容,例如:head -100 myfile.txt,一次显示myfile.txt的头部100行内容。-100等同于-n 100
-c NUM 获取NUM个字节的内容,如,1,1k,1m
posted @ 2021-02-01 21:30  蕝戀  阅读(364)  评论(0编辑  收藏  举报