您的位置:首页 > 大数据 > 人工智能

tail和head命令

2016-06-16 10:33 465 查看
[root@rhel7 ~]# cat rusky   --cat命令查看文件内容
line1
line2
line3
line4
line5
line6
line7
line8
line9
line10
[root@rhel7 ~]# tail -n 3 rusky  --查看最后3行内容
line8
line9
line10
[root@rhel7 ~]# tail -3 rusky    --同上,另一种写法
line8
line9
line10
[root@rhel7 ~]# tail -3 n rusky    --不能写成这两种方式
tail: option used in invalid context -- 3
[root@rhel7 ~]# tail -3n rusky
tail: option used in invalid context -- 3
[root@rhel7 ~]# head -n 3 rusky   --查看前3行内容
line1
line2
line3
[root@rhel7 ~]# head -3 rusky   --同上,另一种写法
line1
line2
line3
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: