[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

chmod



I've been using Linux for awhile but every thing I know is self taught.  That
means I know some things quite well and am abysmally ignorant in other areas.
Hopefully, this question isn't too stupid.  Or maybe it'll give you a good
laugh and you'll take pity on me and answer anyway!

I want to set specific permissions on a group of directories and all
sub-directories.  I can't figure out how to do this other than manually
tracing through the directory tree.

As near as I can tell, chmod has no option to select only directories.  I
figured I'd use ls to list the directories and pipe them to chmod, but ls
doesn't seem to be able to do it either.  Surely I'm missing something.  ls
_has_ to have the equivalent of the DOS command "dir /a:d".  Doing "info ls",
"Which files are listed" shows only -a, -A, -B, -d, -I, -L, -R, none of which
seem to be able to suppress listings based upon permissions or types.

The closest I could figure out was to do:

ls | grep ^d

However, trying to use that method to extract only the directory names and
then pipe them to chmod would have gotten quite convoluted.

So, the primary question is, is there an easy way to set the permission on
directories, only directories, and all sub-directories?  A related question
is how to use ls to list only directories.

And if anyone's in a 'splaining mood, here's another one: how do you set all
files so that the group permissions match the user permissions?  (If you have
three files who's permissions are, for example, 700, 600, 500, and you want
them to be 770, 660, 550 respectively.)

Thanks.


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: