I have two directories that both have a couple thousand files each, and I am trying to grep certain IPs from the files. My grep string is:
grep "IP" cdr/173/07/cdr_2018_07*
This grep string returns "grep: Argument list too long". However, when I do the following:
grep "IP" cdr/173/06/cdr_2018_06*
it returns what I am looking for.
Below is the ls -l for the parent directory for each of these. It seems that the difference is about 400KB, so I'm not sure that size is really the issue here. Am I missing something?
jeblin@debian:~$ ls -l cdr/173
total 18500
REDACTED
drwxr-xr-x 2 jeblin jeblin 2781184 Jul 2 09:34 06
drwxr-xr-x 2 jeblin jeblin 2826240 Aug 1 07:33 07
If it makes a difference, I wrote a Python script that automates this process (searching for multiple IPs), and it works for 06, but not 07 as well, which is why I tried to do the manual grep search first.
$ getconf ARG_MAX
to view your current argument limit in bytes.for
loop orfind
command as an alternative