Mailinglist Archive: opensuse (3100 mails)

< Previous Next >
Re: [SLE] grep - argument list too long
  • From: Randall R Schulz <rschulz@xxxxxxxxx>
  • Date: Thu, 2 Mar 2006 17:38:30 -0800
  • Message-id: <200603021738.30447.rschulz@xxxxxxxxx>
Carl, Peter,

On Thursday 02 March 2006 17:15, Carl Hartung wrote:
> 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
>
> Googled "grep argument list too long", opened the third hit and
> followed the first link:
>
> http://www.gnu.org/software/coreutils/faq/#Argument-list-too-long

Note the use of find's "-print0" option and the corresponding "-0"
option to xargs. This will allow this idiom to work even when file
names have spaces in them.


> regards,
>
> Carl


Randall Schulz

< Previous Next >