命令
rev
描述
reverse lines of a file or files
反转输出,按列输出
用法
1
| rev [options] [file ...]
|
选项
无
注意
无
示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| $ echo a b c > a $ echo 1 2 3 >> a $ more a a b c 1 2 3
$ rev a c b a 3 2 1
$ touch a{1..5} $ ls a a1 a2 a3 a4 a5
$ ls |rev a 1a 2a 3a 4a 5a $ ll total 4 -rw-r--r-- 1 root root 6 Feb 13 20:55 a -rw-r--r-- 1 root root 0 Feb 13 20:55 a1 -rw-r--r-- 1 root root 0 Feb 13 20:55 a2 -rw-r--r-- 1 root root 0 Feb 13 20:55 a3 -rw-r--r-- 1 root root 0 Feb 13 20:55 a4 -rw-r--r-- 1 root root 0 Feb 13 20:55 a5
$ ll |rev 4 latot a 55:02 31 beF 6 toor toor 1 --r--r-wr- 1a 55:02 31 beF 0 toor toor 1 --r--r-wr- 2a 55:02 31 beF 0 toor toor 1 --r--r-wr- 3a 55:02 31 beF 0 toor toor 1 --r--r-wr- 4a 55:02 31 beF 0 toor toor 1 --r--r-wr- 5a 55:02 31 beF 0 toor toor 1 --r--r-wr- $ echo "passwd"|rev dwssap
|