xargs
xargs [选项] # xargs命令一般和管道一起使用参数
说明
多行与单行输出转换
[root@192 test]# echo {1..3}|xargs
1 2 3
[root@192 test]# echo {1..3}|xargs -n 1
1
2
3
# 多行变单行
xargs < test.txt分割字符
指代变量
最后更新于
xargs [选项] # xargs命令一般和管道一起使用[root@192 test]# echo {1..3}|xargs
1 2 3
[root@192 test]# echo {1..3}|xargs -n 1
1
2
3
# 多行变单行
xargs < test.txt最后更新于
[root@192 test]# echo "asdasxasdhajsdxasda" |xargs -d "x"
asdas asdhajsd asda
[root@192 test]# echo `seq 10`|xargs -i touch {}
# 因为-i参数{}指代内容是一行一行的
# 所以这条命令会创建一个"1 2 3 4 5 6 7 8 9 10"的文件