3 Mar
2006
3 Mar
'06
01:14
On Thursday 02 March 2006 20:03, Peter Sutter wrote:
I am trying to use grep/egrep to find a file in the /tmp directory. All I get back is
~# grep -R "a1aaaa" /tmp/* -bash: /usr/bin/grep: Argument list too long
Admittedly, there are numerous files in /tmp, how do I get around this limitation in grep?
for a in /tmp/*; do grep "a1aaaa" $a;
done seems to work for one directory only, but I feel this method to be clumsy as it does not give me recursion into subdirectories. Any way to do it directly with grep/egrep?
Peter
I'm not expert on the CLI but I think: grep -R "a1aaaa" "/tmp/*" Would do it. The '*' expands into a list of all the files and makes for a loooong string.