0

Trying to get a string from a location which has lots of file. Getting error as argument list too long, have tired xargs but there's no support for these advanced keywords

grep 'hello' /file/collection/*/logs/*.log > ~/hello
codeforester
  • 39,467
  • 16
  • 112
  • 140
  • Related: [Does "argument list too long" apply to shell builtins?](https://stackoverflow.com/questions/47443380/does-argument-list-too-long-restriction-apply-to-shell-builtins) – codeforester Nov 23 '17 at 00:51

1 Answers1

0

Try this

$ find /file/collection/*/logs/ -name "*.log" -type f -maxdepth 1 | xargs grep hello
Siju V
  • 143
  • 1
  • 5