首页 > 其他 > 详细

head命令

时间:2018-07-06 16:31:52      阅读:317      评论:0      收藏:0      [点我收藏+]
head命令

output the first part of files输出文件前几行,默认是前10行

使用权限

所有使用者

语法格式

head [OPTION]... [FILE]...

常用选项

-n+数字 显示文件前n行

[root@www1 ~]# seq 1 10 >>test666.txt
[root@www1 ~]# cat test666.txt
aaa 111 222
ccc 333 444
aaa 111 222
ggg 555 666
bbb 777 888
eee 999 000
eee 999 000
1
2
3
4
5
6
7
8
9
10
[root@www1 ~]# head test666.txt
aaa 111 222
ccc 333 444
aaa 111 222
ggg 555 666
bbb 777 888
eee 999 000
eee 999 000
1
[root@www1 ~]# head -n 1 test666.txt
aaa 111 222
[root@www1 ~]# head -2 test666.txt
aaa 111 222
ccc 333 444
[root@www1 ~]#



head命令

原文:http://blog.51cto.com/12107790/2137237

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!