[root@host1 test]# echo -e "1 2 3 4 5 n6 7 8 n9 10 11 12" >example.txt [root@host1 test]# cat example.txt 1 2 3 4 5 6 7 8 9 10 11 12 [root@host1 test]# cat example.txt |xargs 1 2 3 4 5 6 7 8 9 10 11 12
[root@host1 test]# cat example.txt | xargs -n 3 1 2 3 4 5 6 7 8 9 10 11 12
[root@host1 test]# echo "Hello:Hello:Hello:Hello" | xargs -d : -n 2 Hello Hello Hello Hello
[root@host1 test]# cat echo.sh #!/bin/bash echo $* '^-^'
[root@host1 test]# echo -e "TomnHarrynJerrynLucy" > args.txt [root@host1 test]# cat args.txt | xargs bash echo.sh Tom Harry Jerry Lucy ^-^ [root@host1 test]# cat args.txt | xargs -n 2 bash echo.sh Tom Harry ^-^ Jerry Lucy ^-^
[root@host1 test]# bash echo.sh Welcome Tom Welcome Tom ^-^
[root@host1 test]# bash echo.sh Welcome Tom [root@host1 test]# bash echo.sh Welcome Herry [root@host1 test]# bash echo.sh Welcome Jerry [root@host1 test]# bash echo.sh Welcome Lucy
[root@host1 test]# cat args.txt | xargs -I {} bash echo.sh Welcome {}
Welcome Tom ^-^
Welcome Harry ^-^
Welcome Jerry ^-^
Welcome Lucy ^-^
[root@host1 test]# find . -type f -name "*.txt" -print | xargs rm -f
[root@host1 test]# find . -type f -name "*.txt" -print0 | xargs -0 rm -f
[root@host1 test]# cat files.txt | (while read arg ;do cat $arg;done)
[root@host1 test]# cat files.txt | xargs -I {} cat {}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有