SED/AWK
SED
替换两文件中的单词,合并输出到另一文件。
sed-es/Paul/Pablo/gnames1.txtnames2.txt>names3.txt
使用-e可以指定多个编辑命令
sed-e's/Paul/Pablo/g;s/Pat/Patricia/'names1.txtnames2.txt
命令用;分开
也可分别使用-e
sed-e's/Paul/Pablo/g'-e's/Pat/Patricia/'names1.txtnames2.txt
使用-f可以从文件中读取编辑指令
sed-fedits.sedscrnames1.txtnames2.txt>names3.txt
edits.sedscr:
s/Pat/Patricia/
s/Tom/Thomas/
1d
AWK:
awk-F":"'{print"username:"$1"\t\t\tuserid:"$3}'/etc/passwd
awk与sort
awk'/baidu/{print$1}'baidu.txt|sort-nrk2
awk'/baidu/&&$2<800{print$1}'baidu.txt|sort-nrk2
相关推荐
fendou00sd 2020-06-16
Darklovy 2019-12-03
yoshubom 2015-01-18
qidu 2019-11-10
老谢的自留地 2020-05-09
chenchuang 2020-01-25
fendou00sd 2020-01-07
chenpro 2020-07-04
RealJianyuan 2020-06-14
cwgxiaoguizi 2020-06-05
chenpro 2020-06-02
Neptune 2020-05-31
YukiRain 2020-05-08
baobaozai 2020-04-29
Proudoffaith 2020-04-08
fenxinzi 2020-03-01
zhiliang 2020-01-31
wannagonna 2020-01-13
wandererdl 2019-12-25