Linux命令详解:[15]head/tail开头结尾显示

2025-03-12 10:25:42

1、进入root目录,在该目录下打印Linux.txt文件的前十行,命令:head Linux.txt 。

Linux命令详解:[15]head/tail开头结尾显示

2、打印Linux.txt文件的后十行,命令:tail Linux.txt 。

Linux命令详解:[15]head/tail开头结尾显示

3、打印Linux.txt文件的前五行,命令:head -n 5 Linux.txt 。

Linux命令详解:[15]head/tail开头结尾显示

4、打印Linux.txt文件的后五行,命令:tail -n 5 Linux.txt。

Linux命令详解:[15]head/tail开头结尾显示

5、实时显示/var/log/message日志的内容,命令:tail -f /var/log/message 。

Linux命令详解:[15]head/tail开头结尾显示
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢