Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Jun 2002 17:04:27 -0500 (CDT)
From:      Steven Lake <raiden@shell.core.com>
To:        Ryan Thompson <ryan@sasknow.com>
Cc:        Steven Lake <raiden@shell.core.com>, <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Questions about Chmod
Message-ID:  <Pine.GSO.4.44L0.0206031702280.18813-100000@shell.core.com>
In-Reply-To: <20020603155826.B81228-100000@ren.sasknow.com>

next in thread | previous in thread | raw e-mail | index | archive | help
	ah, so it's happily mixing the find command with the chmod
command.  that works.

	But that still leaves my first question unanswered.  How do I
recursively change permissions on only directories without changing the
permission on the files in them?

On Mon, 3 Jun 2002, Ryan Thompson wrote:

> Steven Lake wrote to freebsd-questions@FreeBSD.ORG:
>
> > 	I've got two questions about Chmod that I couldn't answer via the
> > man pages.  Either I'm not reading good enough or the answer isn't there.
> >
> > 	1.  Recursive item only changes
> > 	2.  Selective file changes
> >
> > 	Ok, the first thing I'm curious of is how to do a recursive chmod
> > on say directories only.  This also plays into the second question which
> > is how do I do a recursive or system wide chmod on only certain files
> > based on a variable or name.
>
>
> > So like if I wanted to chmod 755 all
> > directories on a system with the name "WWW",
>
> 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.
>
>
> > or with all files containing
> > the letters "BLD".
>
> chmod 755 `find . -name "*BLD*" -print`
>
> Just be careful out there. It's a big bad filesystem. :-)
>
>
> Hope this helps,
> - Ryan
>
> --
>   Ryan Thompson <ryan@sasknow.com>
>
>   SaskNow Technologies - http://www.sasknow.com
>   901 1st Avenue North - Saskatoon, SK - S7K 1Y4
>
>         Tel: 306-664-3600   Fax: 306-664-3630   Saskatoon
>   Toll-Free: 877-727-5669     (877-SASKNOW)     North America
>
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.44L0.0206031702280.18813-100000>