持续更新。。。
[rootgoldboyedu ~]# echo oldboy0{1…5}
oldboy01 oldboy02 oldboy03oldboy04 oldboy05
oldboy10 [rootloldboyedu ~]# echo oldboy{01…10} | xargs -n1 oldboy01
。。。
oldboy05
[root@oldboyedu~]# echo oldboy0{1…5}lxargs -n1 l sed -r ‘s#(.*)#useradd \1#g’
useradd oldboy01
useradd oldboy02
useradd oldboy03
useradd oldboy04
useradd oldboy05
-r 表示sed使用正则
(.*) 表示每行所有内容
\1 表示引用.*的内容
把密令交给之编译器执行
[rootQoldboyedu~]# echo oldboy0{1…5}|xargs -nllsed-r ‘s#(.*)#useradd \1#g’|bash
useradd:user 'oldboy02’already exists
useradd:user 'oldboy03’already exists
useradd:user 'oldboy04’already exists
useradd:user 'oldboy05’already exists
hostname
快速去本机ip方法:
[rootgoldboyedu~]# hostname-i
10.0.0.200
xargs:两组显示成一行
[rootQoldboyedu~]#sed’='person.txt
1
103,aaaa,CE0
2
104,aaaa,CE0
[rootloldboyedu~]# sed ‘=’ person.txt l xargs -n2
1 103,aaaa,CE0
2 104,aaaa,CE0