曲径通幽论坛

标题: tac 反向显示 [打印本页]

作者: beyes    时间: 2009-1-5 01:59
标题: tac 反向显示
cat 正向显示文本内容
tac 倒过来写的 cat ,也是反过来显示内容。

举例(cat 的正向显示):
[root@localhost Desktop]# cat test.txt
tab     tab     tab
yes     yes     yes

tac的反向显示:
[root@localhost Desktop]# tac test.txt
yes     yes     yes
tab     tab     tab

默认情况下,tac 所使用的分隔符是 \n 换行符,但我们可以使用 -s 参数自定义一个分隔符,比如:
# head -n 1 /etc/passwd | tac -s ":"
/bin/bash
/root:root:0:0:x:root:





欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) Powered by Discuz! X3.2