Linux命令(112)之tac

简介: Linux命令(112)之tac

linux命令之tac

1.tac介绍
linux命令tac是将文件内容反向输出,其与命令cat输出刚好相反

2.tac用法
tac [参数] filename

tac参数
参数 说明
--version 显示版本信息
--help 显示帮助信息
3.实例
3.1.显示tac的版本信息
命令:

tac --version

[root@rhel77 ~]# tac --version
tac (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Lepreau and David MacKenzie.
[root@rhel77 ~]#
3.2.显示tac的帮助信息
tac --help

[root@rhel77 ~]# tac --help
Usage: tac [OPTION]... [FILE]...
Write each FILE to standard output, last line first.
With no FILE, or when FILE is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.
-b, --before attach the separator before instead of after
-r, --regex interpret the separator as a regular expression
-s, --separator=STRING use STRING as the separator instead of newline
--help display this help and exit
--version output version information and exit

GNU coreutils online help: http://www.gnu.org/software/coreutils/
For complete documentation, run: info coreutils 'tac invocation'
[root@rhel77 ~]#
3.3.反向显示zzz.txt文件内容
命令:

tac zzz.txt

[root@rhel77 ~]# tac zzz.txt
loveable aaaa

a 145 dd
a 135 dd
a 1[34]5 dd

aaa
1 111 111
2 222 222
1 111 111
aaaa bbbb cccc

this is a test line
aaa bbb ccc
this is a test line
123acb111 error 11111

123acb111 aaaa bbbb
[root@rhel77 ~]# cat zzz.txt
123acb111 aaaa bbbb

123acb111 error 11111
this is a test line
aaa bbb ccc
this is a test line

aaaa bbbb cccc
1 111 111
2 222 222
1 111 111
aaa

a 1[34]5 dd
a 135 dd
a 145 dd

loveable aaaa
[root@rhel77 ~]#

————————————————
版权声明:本文为CSDN博主「小黑要上天」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/z19861216/article/details/134153842

目录
相关文章
|
1天前
|
安全 Linux 开发者
Linux笔记之ldd命令详解
`ldd`命令是Linux环境下一个非常实用的工具,用于显示一个程序运行时所需的共享库依赖。它帮助开发者和系统管理员快速诊断程序运行问题,特别是在处理"找不到库文件"或者"错误的库文件版本"等错误时。然而,出于安全的考虑,对于不信任的可执行文件,应该慎用 `ldd`命令,可以考虑使用其他工具如 `objdump`。总的来说,懂得如何妥善且安全地使用 `ldd`,对于维护一个稳定和高效的Linux系统来说,是非常重要的。
16 9
|
2天前
|
Linux Shell
linux命令
linux命令是对Linux系统进行管理的命令。对于Linux系统来说,无论是中央处理器、内存、磁盘驱动器、键盘、鼠标,还是用户等都是文件,Linux系统管理的命令是它正常运行的核心,与之前的DOS命令类似。linux命令在系统中有两种类型:内置Shell命令和Linux命令。
|
3天前
|
移动开发 运维 网络协议
运维必备 | Linux netstat命令详解
运维必备 | Linux netstat命令详解
|
3天前
|
Linux
真香~ Linux vi常用命令汇总!
真香~ Linux vi常用命令汇总!
|
3天前
|
Linux Shell
linux命令
linux命令是对Linux系统进行管理的命令。对于Linux系统来说,无论是中央处理器、内存、磁盘驱动器、键盘、鼠标,还是用户等都是文件,Linux系统管理的命令是它正常运行的核心,与之前的DOS命令类似。linux命令在系统中有两种类型:内置Shell命令和Linux命令。
|
2天前
|
SQL 存储 分布式计算
Linux退出Hive命令
【8月更文挑战第14天】
|
2天前
|
Linux
会玩这10个Linux命令,一定是个有趣的IT男!
会玩这10个Linux命令,一定是个有趣的IT男!
|
3天前
|
Linux Shell 数据库
退休前一天都还在用的Linux常用命令!建议收藏!
退休前一天都还在用的Linux常用命令!建议收藏!
|
2天前
|
Linux Shell
危险!这10个Linux命令慎用,否则可能牢底坐穿!
危险!这10个Linux命令慎用,否则可能牢底坐穿!
|
3天前
|
Ubuntu Linux Shell
这7个重要的Linux命令,每一位Linux工程师都必须盘它!
这7个重要的Linux命令,每一位Linux工程师都必须盘它!