tr,col,expand,paste,join

[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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值