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

目录
相关文章
|
3天前
|
安全 Linux
Linux系统之lsof命令的基本使用
【10月更文挑战第14天】Linux系统之lsof命令的基本使用
25 2
Linux系统之lsof命令的基本使用
|
5天前
|
Linux
Linux 系统五种帮助命令的使用
Linux 系统五种帮助命令的使用
30 14
|
1天前
|
运维 网络协议 Linux
linux系统命令 losf详解
**lsof命令**(List Open Files)是Linux系统中一个非常实用的工具,用于列出当前系统上所有打开的文件以及与之关联的进程。以下是对lsof命令的详细介绍: ### 一、基本功能 lsof命令可以显示系统中被进程打开的文件,这些文件可以是普通文件、目录、网络套接字、设备文件等。通过lsof命令,用户可以方便地查看哪些文件被哪些进程打开,以及这些文件的状态信息。 ### 二、基本语法 lsof命令的基本语法为:`lsof [选项] [文件]`。其中,选项用于指定lsof命令的行为,文件则是可选的,用于指定要查询的文件。 ### 三、常用选项 * `-a` 或 `-
|
1天前
|
Linux Perl
Linux awk命令使用技巧
【10月更文挑战第16天】Linux awk命令使用技巧
9 4
|
6天前
|
Linux
Linux经常使用命令汇总和总结
Linux经常使用命令汇总和总结
25 1
|
6天前
|
安全 Linux Shell
Linux | Rsync 命令:16 个实际示例(上)
Linux | Rsync 命令:16 个实际示例(上)
20 0
Linux | Rsync 命令:16 个实际示例(上)
|
9天前
|
存储 安全 Linux
Linux文件管理命令md5sum awk
通过结合 `md5sum`和 `awk`,不仅可以高效地进行文件完整性校验,还能灵活地处理和分析校验结果,为系统管理、数据审计等工作提供强大的支持。
20 2
|
10天前
|
运维 Java Linux
Linux 下命令后台运行秘籍:无惧终端断开的魔法
本文详细介绍了在 Linux 系统下使命令不受终端断开影响、持续在后台运行的多种方法及其原理。包括使用 `nohup`、`setsid`、括号括起来、作业调度和 `screen` 等技巧,帮助读者提高工作效率,确保任务不被意外中断。
40 0
Linux 下命令后台运行秘籍:无惧终端断开的魔法
|
5天前
|
Unix Linux 开发工具
Linux Vim的 命令大全
Linux Vim的 命令大全
12 0
|
9天前
|
Linux
linux/mac 下查看、修改文件权限的命令
这篇文章介绍了在Linux和Mac操作系统下如何查看和修改文件及文件夹的权限。
13 0