tac命令 – 反向列示文件内容

tac命令就是将文件反向输出,刚好和cat输出相反。

语法格式:tac [参数] [文件]

常用参数:

-b 在行前而非行尾添加分隔标志
-r 将分隔标志视作正则表达式来解析
-s 使用指定字符串代替换行作为分隔标志
–version 显示版本信息并退出
–help 显示此帮助信息并退出

参考实例

反向列出test.txt文件的内容:

[root@xtuos.com ~]# cat test.txt 
hello world
hello xtuos.com
hello linuxprobe
[root@xtuos.com ~]# tac test.txt 
hello linuxprobe
hello xtuos.com
hello world

未经允许不得转载:统信UOS之家 » tac命令 – 反向列示文件内容

相关文章