尝试从包含大量文件的位置获取字符串。获取误差argument list too long
,已经累xargs
但有这些先进的关键字不支持获取“参数列表太长”错误
grep 'hello' /file/collection/*/logs/*.log > ~/hello
尝试从包含大量文件的位置获取字符串。获取误差argument list too long
,已经累xargs
但有这些先进的关键字不支持获取“参数列表太长”错误
grep 'hello' /file/collection/*/logs/*.log > ~/hello
试试这个
$ find /file/collection/*/logs/ -name "*.log" -type f -maxdepth 1 | xargs grep hello
Siju,“xargs”似乎没有在这个环境下工作 –
@PiyushWakhale请参阅https://stackoverflow.com/a/18647755/4082052 – Sundeep
我删除了-maxdepth标志和我吨工作,thanx :) –
相关:请问“参数列表太长” 适用于shell内建?](HTTPS ://sackoverflow.com/questions/47443380/does-argument-list-too-long-restriction-apply-to-shell-builtins) – codeforester