Date: Mon, 3 Jun 2002 16:06:45 -0600 (CST) From: Ryan Thompson <ryan@sasknow.com> To: Steven Lake <raiden@shell.core.com> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Questions about Chmod Message-ID: <20020603160504.S81228-100000@ren.sasknow.com> In-Reply-To: <Pine.GSO.4.44L0.0206031702280.18813-100000@shell.core.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Steven Lake wrote to Ryan Thompson: > 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? find(1) is still your friend :-) Add -type d to your find arguments to only find directories. - Ryan > > 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 > > > > > > -- 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?20020603160504.S81228-100000>