[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Re:Help Navigating Directories
- Subject: Re: [cobalt-users] Re:Help Navigating Directories
- From: Larry Smith <lesmith@xxxxxxxxx>
- Date: Thu Feb 21 15:51:01 2002
- Organization: ECSIS.NET
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
INRE Re: [cobalt-users] Re:Help Navigating Directories:
Brandon,
> Larry and Charlie, thank you very much for straightening me out here!
> Is there a way to chmod recursively without affecting directories?
> Thanks again,
Not really, but what I do (generally just from command line, but this could
be written to a file and made a "script") is the following:
============ CUT HERE ============================
for fn in `find . -print`
do
if [ -d $fn ]
then
chmod 775 $fn
else
chmod 664 $fn
fi
done
============ CUT HERE ============================
The "-print" is not "required" but I like to be explicit. What this will
do is change all directories _from_where_you_are down to 775 and all files
from there down to 664. Add a #!/bin/sh _before_ the for line, write to a
script name (chmod-tree ??) and you have a script to do the chmod for you...
Larry Smith
SysAd ECSIS.NET
sysad@xxxxxxxxx