Re: Shell script: find

From: Holger.VanKoll@SWISSCOM.COM
Date: Tue Sep 09 2003 - 07:00:23 EDT


> find /usr/lpp/* -prune
> find /usr/lpp/.[0-z]* /usr/lpp/* -prune
>Note that either of these could fail if you have too many files in your
path.

it should be fine to use "/some/path/*" etc., shouldnt it?
sorry, no time to test

-----Original Message-----
From: Bill Thompson [mailto:bill.thompson@GOODYEAR.COM]
Sent: Tuesday, September 09, 2003 12:50 PM
To: aix-l@Princeton.EDU
Subject: Re: Shell script: find

Rad,

Let's say you were looking for all the stuff in /usr/lpp, but none of
the subdirectories. You could use the following notation:

      find /usr/lpp/* -prune

If you wanted to find the "hidden" files as well (those starting with a
dot), this should work:

      find /usr/lpp/.[0-z]* /usr/lpp/* -prune

Note that either of these could fail if you have too many files in your
path.

Another way to do it without using find:

      for FILE in $(ls /usr/lpp); do
          echo /usr/lpp/$FILE
      done

HTH

Bill Thompson
Sr UNIX Systems Administrator
The Goodyear Tire & Rubber Co.

Contains Confidential and/or Proprietary Information
May Not Be Copied or Disseminated Without Express Consent of The
Goodyear Tire & Rubber Company.

AIX-L Archives: http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2

----- Original Message -----
From: "Rioveros, Dario C." <riovdac@RSDEVT.INSULAR.COM.PH>
Newsgroups: bit.listserv.aix-l
To: <aix-l@Princeton.EDU>
Sent: Monday, September 08, 2003 11:44 PM
Subject: Shell script: find

> Hi AIX people,
>
> I need a little help here. how can I find the files only on
> the
indicated PATH
> and will not search on its subdirectories. (non-recursive find).
>
> Thanks.
> rad



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:10 EDT