[root@IPv6 gaole_scripts]#
[root@IPv6 gaole_scripts]# test="test12345"
[root@IPv6 gaole_scripts]# test1="test123445"
[root@IPv6 gaole_scripts]# echo $test1 | tr -s 4
test12345
[root@IPv6 gaole_scripts]# echo $test1
test123445
[root@IPv6 gaole_scripts]# echo $test1 | tr -s 4 #-s squeeze, 保留第一个4
test12345
[root@IPv6 gaole_scripts]# echo $test1 | tr "12345" "123445" #替换字符集,1对1,2对2,3对3,4对4,5对4。
test123444
[root@IPv6 gaole_scripts]#
[root@IPv6 gaole_scripts]#
[root@IPv6 gaole_scripts]# echo $test1 | tr "21345" "bacde" #
testabcdde
[root@IPv6 gaole_scripts]# echo $test1 | tr -d "12345" #-d必须要写出来,表示删除字符集
test
[root@IPv6 gaole_scripts]# echo $test1 | tr -d "t=5"
es12344
col:tab转换为空格。
cat /etc/man.config | col -x
join 文件有相同内容的两行连一起,paste,不管有没有直接连一起。
expand也是tab变
成空格,但是要指定换成空格的个数 cat /etc/man.config | expand -t 6变成6个空格
split:切割文本
split -b 300k a.txt prefix