Date: Wed, 5 Jun 2002 08:03:39 +0300 (EEST) From: Alexander V Zubchenko <stalker@hermes-comp.zp.ua> To: "Morse, Richard E." <REMORSE@PARTNERS.ORG> Cc: "'Ryan Thompson'" <ryan@sasknow.com>, Steven Lake <raiden@shell.core.com>, <freebsd-questions@FreeBSD.ORG> Subject: RE: Questions about Chmod Message-ID: <20020605080125.V38194-100000@server.hermes-comp.zp.ua> In-Reply-To: <375F68784081D511908A00508BE3BB1701EF1B2F@phsexch22.mgh.harvard.edu>
index | next in thread | previous in thread | raw e-mail
Greetings, All!
On Tue, 4 Jun 2002, Morse, Richard E. wrote:
> Ryan Thompson [mailto:ryan@sasknow.com] wrote:
>
> > find(1) will assist you with this. find(1) allows you to apply
> > commands to each file it matches. So, something like
> >
> > chmod 755 `find . -name "WWW" -print`
> >
> > Should do the trick.
>
> This will possbily have a problem: find will output a newline separated
> list. This could confuse the chmod command....
>
> instead: read the find manpage, as well as the xargs manpage. You should be
> able to type something _like_ (I'm not positive it's exactly this, but it
> approaches)
>
> find . -name "WWW" -exec "chmod 755 {}" -print
>
> or:
>
> find . -name "WWW" -print | xargs chmod 755
And i want to add two other examples:
chmod 755 `find . -name "WWW" -print`
or:
foreach i (`<find_cmd>`); chmod 755 $i; end
>
> People differ on which version they prefer, and in some situations they like
> one or the other (I think it depends on if they feel like piping through a
> tee or not...)
>
> HTH,
> Ricky
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>
Alexander
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020605080125.V38194-100000>
