命令格式
head [参数] 文件名
命令功能
显示文件开头,默认显示10行
命令参数
head --help
![](https://img.haomeiwen.com/i1409863/d05429297c3bbd5d.png)
常用命令
- 输出开始前100行
head -n 100 file.txt
- 输出文件最后100行内容
head -n -100 file.txt
- 显示文件前20个字节
head -c 20 file.txt
- 显示除最后20个字节以外的内容
head -c -20 file.txt
head [参数] 文件名
显示文件开头,默认显示10行
head --help
head -n 100 file.txt
head -n -100 file.txt
head -c 20 file.txt
head -c -20 file.txt
本文标题:head 命令
本文链接:https://www.haomeiwen.com/subject/bqnedttx.html
网友评论