head,在linux系统中常用来显示开头或者结尾某些文字块到标准输出中,命令格式为head [参数] 文件
1. 显示文件的前5行到标准输出中
head -n 5 test.c
2. 显示文件除了最后五行的全部行到标准输出中
head -n -5 test.c
3. 显示文件的前20个字节
head -c 20 test.c
4. 显示文件除最后20个字节以外的所有字节
head -c -20 test.c
参考:
https://www.cnblogs.com/peida/archive/2012/11/06/2756278.html