2017-10-11 115 views
0

尝试从包含大量文件的位置获取字符串。获取误差argument list too long,已经累xargs但有这些先进的关键字不支持获取“参数列表太长”错误

grep 'hello' /file/collection/*/logs/*.log > ~/hello 
+0

相关:请问“参数列表太长” 适用于shell内建?](HTTPS ://sackoverflow.com/questions/47443380/does-argument-list-too-long-restriction-apply-to-shell-builtins) – codeforester

回答

0

试试这个

$ find /file/collection/*/logs/ -name "*.log" -type f -maxdepth 1 | xargs grep hello 
+0

Siju,“xargs”似乎没有在这个环境下工作 –

+0

@PiyushWakhale请参阅https://stackoverflow.com/a/18647755/4082052 – Sundeep

+0

我删除了-maxdepth标志和我吨工作,thanx :) –