cat查看:
[root@localhost test]# cat a 1 2 3
[root@localhost test]# cat -s a 1 2 3
[root@localhost test]# cat -b a 1 1 2 2 3 3
tac逆着输出:
[root@localhost test]# printf "1\n2\n3\n4\n"|tac 4 3 2 1
rev 同一行逆着输出:
[root@localhost test]# printf "1 2 3 4"|tac 1 2 3 4[root@localhost test]#
vim d:下列代码都是对此进行修改
aaaaaaaaaaaa bbbbbbbbbbbb cccccccccccc 12344566 21312asdasdffsa asdasd12eqwdas dsadas12eqwd asdsad21 abc sda dwdf sadas sad asd 21ed 12d1 2ed 1d1 111 111 111 12 23 123 412
head 用法:
[root@localhost test]# head -n 3 ./d aaaaaaaaaaaa bbbbbbbbbbbb cccccccccccc
[root@localhost test]# head -c 4 ./d aaaa
类似的tail用法:
[root@localhost test]# tail -c 4 ./d 412 [root@localhost test]# tail -n 4 ./d sadas sad asd 21ed 12d1 2ed 1d1 111 111 111 12 23 123 412
查第三行:
[root@localhost test]# head -n 3 ./d | tail -n 1 cccccccccccc
替换:
[root@localhost test]# cat d |tr a 1 111111111111 bbbbbbbbbbbb cccccccccccc 12344566 213121sd1sdffs1 1sd1sd12eqwd1s ds1d1s12eqwd 1sds1d21 1bc sd1 dwdf s1d1s s1d 1sd 21ed 12d1 2ed 1d1 111 111 111 12 23 123 412
wc用法:
-l:统计行数
-w:统计单词个数
-c:统计字节数
[root@localhost test]# wc -l d 13 d [root@localhost test]# wc -w d 25 d [root@localhost test]# wc -c d 173 d