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 |
本文来自博客园,作者:蕝戀,转载请注明原文链接:https://www.cnblogs.com/juelian/p/14359145.html