[Gllug] shell quoting problem

Bruce Richardson itsbruce at workshy.org
Wed Jul 2 10:40:01 UTC 2008


On Wed, Jul 02, 2008 at 11:01:49AM +0100, Alain wrote:
> On Wed, Jul 02, 2008 at 10:51:05AM +0100, Andy Millar wrote:
> > Have you tried something like:
> > 
> > find / -name "*John Smith*"
> > 
> > And, if you want to ls them, you could:
> > 
> > ls -l `find / -name "*John Smith*"`
> 
> * locate (essentially) does the same job as 'find /' but is much faster.

But will not find recent files.

> * your solution has the same space problem.

  find / -name "*John Smith*" | xargs -iXXX ls -l "XXX"
 
or

  find / -name "*John Smith*" -exec ls -l {\} \;

The xargs solution is more efficient.

-- 
Bruce

Bitterly it mathinketh me, that I spent mine wholle lyf in the lists
against the ignorant.  -- Roger Bacon, "Doctor Mirabilis"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20080702/51067c1f/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list