[GLLUG] Linux File / Directory Permissions

Ben Pfaff blp at cs.stanford.edu
Sun Jul 11 15:08:35 EDT 2004


"Ex Fed" <exfed at hotmail.com> writes:

> How can I set all subdirectories of a specific directory as executible
> for User, Group or OTHER and leave the files in these sub directories
> as not executible?

This is a confusing question.  Directories are not really
executable; for a directory, the "executable" bit controls
whether files and directory in the subdirectory can be accessed
by name.

However, I think you might be looking for something like this:
        for d in dir/*; do test -d "$d" && chmod -- 0755 "$d"; done
That's untested, but I think it does what you asked for.  Or
maybe you really want
        find dir -type d -exec chmod -- 0755 '{}' \;
-- 
"Then, I came to my senses, and slunk away, hoping no one overheard my
 thinking."
--Steve McAndrewSmith in the Monastery


More information about the linux-user mailing list