使用 gnu parallel 一次多个参数
multiple arguments at a time with gnu parallel
是否可以让 GNU 并行地一次调用带有多个参数的命令,达到某个限制?
只是为了解释,一个简单的例子...
制作一些文件:
seq 10 | parallel touch test_files{}.txt
要删除它们,我可以这样做:rm ./test_files*.txt
、
或等效于 GNU 并行:ls ./test_files*.txt | parallel rm
,
其中 运行s rm
每个文件一次。
有没有什么方法可以告诉 GNU 并行于 运行 具有最大参数数量的命令,例如...
ls ./test_files*.txt | parallel --max-args 5 rm
将启动
rm test_files1.txt test_files2.txt test_files3.txt test_files4.txt test_files5.txt
rm test_files6.txt test_files7.txt test_files8.txt test_files9.txt test_files10.txt
$ seq 10 | parallel --max-args 5 echo
1 2 3 4 5
6 7 8 9 10
是否可以让 GNU 并行地一次调用带有多个参数的命令,达到某个限制?
只是为了解释,一个简单的例子...
制作一些文件:
seq 10 | parallel touch test_files{}.txt
要删除它们,我可以这样做:rm ./test_files*.txt
、
或等效于 GNU 并行:ls ./test_files*.txt | parallel rm
,
其中 运行s rm
每个文件一次。
有没有什么方法可以告诉 GNU 并行于 运行 具有最大参数数量的命令,例如...
ls ./test_files*.txt | parallel --max-args 5 rm
将启动
rm test_files1.txt test_files2.txt test_files3.txt test_files4.txt test_files5.txt
rm test_files6.txt test_files7.txt test_files8.txt test_files9.txt test_files10.txt
$ seq 10 | parallel --max-args 5 echo
1 2 3 4 5
6 7 8 9 10