SUMMARY: find syntax

From: Donald McLachlan (
Date: Mon Aug 10 1992 - 19:09:25 CDT

First, my original problem ...

>I do not seem to be able to build a find command which will skip both
>/tmp and /home, but ls everything else.
>I could run the following two commands and use comm to merge their output.
> find / -name /tmp -prune -o -ls > /tmp/junk
> find / -name /home -prune -o -ls > /tmp/junk1
>But I think it would be nice to do a single find.
>Any and all help will be appreciated.

As it turned out, I found a functional syntax about an hour after posting, but
it did not do exactly what I wanted. (Part of my problem was forgetting to hide things from the shell.)

I wound up using
        find / -name tmp -prune -o -name home -prune -o -ls

This (as many people pointed out) will remove any file named tmp such as
/etc/tmp since -name is essentially `basename {}`. Many folks found some
interesting ways to overcome this problem.

I think the real solution (which 3 people mentioned) is to get, and use GNUfind.
I provides a -path option which compares the arg against {}. This is
what I really wanted, so I will give that a try.

Thanks to all who responded, Don

From: Lutz Brunke <>
From: Robert L Krawitz <rlk@Think.COM>
From: (Charles H. Buchholtz)
From: Dieter Muller <>
From: Casper Dik <>
From: Jon Peatfield <>
From: (Tom Poage)
From: (Gerald Justice)
From: (Guy Harris)
From: Mike Raffety <>
From: (Peter Samuel)
From: Clive Newall <clive@asis.unimelb.EDU.AU>
From: (Ercument Canver)
From: Arie Bikker <>
From: trdlnk!mike@uunet.UU.NET (Michael Sullivan)
From: Joe Konczal <>

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:47 CDT