From owner-freebsd-questions Tue Sep 24 16:30:57 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F22437B401 for ; Tue, 24 Sep 2002 16:30:55 -0700 (PDT) Received: from mailc.telia.com (mailc.telia.com [194.22.190.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 431C243E81 for ; Tue, 24 Sep 2002 16:30:54 -0700 (PDT) (envelope-from erikt@midgard.homeip.net) Received: from d1o913.telia.com (d1o913.telia.com [195.252.44.241]) by mailc.telia.com (8.12.5/8.12.5) with ESMTP id g8ONUqOJ004187 for ; Wed, 25 Sep 2002 01:30:52 +0200 (CEST) X-Original-Recipient: Received: from falcon.midgard.homeip.net (h63n1fls20o913.telia.com [212.181.162.63]) by d1o913.telia.com (8.8.8/8.8.8) with SMTP id BAA28614 for ; Wed, 25 Sep 2002 01:30:52 +0200 (CEST) Received: (qmail 5075 invoked by uid 1001); 24 Sep 2002 23:30:50 -0000 Date: Wed, 25 Sep 2002 01:30:49 +0200 From: Erik Trulsson To: Peter Leftwich Cc: FreeBSD LIST Subject: Re: how to find executable files Message-ID: <20020924233049.GA3216@falcon.midgard.homeip.net> Mail-Followup-To: Peter Leftwich , FreeBSD LIST References: <20020924191230.B66173-100000@earl-grey.cloud9.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020924191230.B66173-100000@earl-grey.cloud9.net> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Sep 24, 2002 at 07:13:51PM -0400, Peter Leftwich wrote: > Two questions, first is why doesn't this work, or is there a flag I can use > with "ls?" > > # find . -type f -perm +x > find: -perm: x: illegal mode string > # find . -type f -perm +x -print > find: -perm: x: illegal mode string For -perm you first use + or - and then the mode. The mode is specified as for chmod, i.e. things like 'u+x' for user executable, 'g-w' for non-groupwritavle or '+x' for executable by somebody. (Numeric modes also work.) So in your case you would get: find . -type f -perm '++x' (The single quotes around ++x seem to be necessary for me. Probably my shell trying to interpret ++ in some way...) > > Question II: Is find always recursive (through subdirectories) or can this > be limited to x levels down? Thanks. find . -maxdepth 4 (Or some other number instead of 4.) (This, along with everything else, is fairly clearly documented in the manpage for find(1).) > > -- > Peter Leftwich > President & Founder > Video2Video Services > Box 13692, La Jolla, CA, 92039 USA > +1-413-403-9555 > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message