GNU Parallel,输入文件太多,参数列表太长 [英] GNU Parallel, too many input files, Argument list too long

查看:220
本文介绍了GNU Parallel,输入文件太多,参数列表太长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用GNU Parallel在Macbook上运行这样的命令:

I run a command like this on my macbook, using GNU Parallel:

parallel "sample operation" ::: samplefolder/*.txt

问题是samplefolder中有20,000个txt文件,这会导致Argument list too long错误.

The problem is that I have 20,000 txt files in the samplefolder, which cause a Argument list too long error.

当我尝试在ubuntu计算机上运行相同的脚本时,没有任何问题.

And there's no such a problem when I tried run the same script on an ubuntu machine.

我尝试谷歌搜索并读取了一些man文件,但是没有运气.我怎么解决这个问题?

I tried googling and reading some man files, but no luck. How can I solve this problem?

谢谢!

推荐答案

尝试:

ls samplefolder | grep \.txt | parallel "sample operation samplefolder/{}" 

这篇关于GNU Parallel,输入文件太多,参数列表太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆