tail命令 查看文件尾部 输出文件后n行,默认查看文件的后10行

 

 

 tail命令 查看文件尾部  用于查看日志

默认查看文件的后10行

-n 3 数字   也可以忽略-n 直接加数字

tail 3 查看文件后3行

[root@localhost ~]# tail /etc/passwd            // 默认查看文件的后十行
[root@localhost ~]# tail -n 3 /etc/passwd       // 查看文件的后三行
[root@localhost ~]# tail -f /var/log/messages   // 动态查看文件内容
[root@localhost ~]# tail -fn  10 /etc/passwd     //查看文件的最后10行,动态查看文件内容

 

-f 动态实时显示文件内容

posted @ 2017-11-05 17:50  minger_lcm  阅读(950)  评论(0编辑  收藏  举报