in reply to Re: Re: grep or perl
in thread grep or perl

I wish to copy files that do not contain NNNNNs.
Ah yes, sorry you'll want the -L switch as nite_man mentioned. That will output all the files that did not match the criteria.
Also I don't understand what the program xargs does
It's roughly equivalent to
perl -e 'exec "@ARGV " . join " ", <>'
So execute the given program and provided parameters and then add anything read from the pipe as arguments.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: Re: Re: grep or perl
by revdiablo (Prior) on Jun 05, 2003 at 00:01 UTC

    It's roughly equivalent to

    perl -e 'exec "@ARGV " . join " ", <>'

    So execute the given program and provided parameters and then add anything read from the pipe as arguments.

    This is true, but it might also be useful to note that xargs breaks the command line up into chunks small enough to fit on one command. For example, if you tried passing 40,000 filenames as one big long command line, it wouldn't work. Instead you could echo the 40,000 filenames into xargs (or, more realistically, pipe the output from find or grep), which will break them up accordingly.

    As a fun test, try the following: echo `find /usr -type f` vs find /usr -type f | xargs echo