[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: chmod directory mode extention
From: |
Alan Curry |
Subject: |
Re: chmod directory mode extention |
Date: |
Sat, 20 Feb 2010 19:50:52 -0500 (GMT+5) |
seaking1 writes:
>
> Hello,
>
> I would like to suggest and offer the code to extend chmod in a small
> way. My extension merely allows for a different mode to be applied to
> directories than the one applied to all other files. I have looked for this
> utility but never found it and being such a useful addition though it may be
> possible to add it to the standard release.
>
> What it does: Add an option -d|--dirmode to chmod that will give all
> directories in the files chmod is told to change the mode specified by the
> -d argument instead of the other mode.
> Reason: I have found this to be a necessity. Say for example I have a
> directory structure filled with data files of some sort and they are of
> assorted permissions; If I chmod -R 664 foo/ or something to that effect It
> will of course give all the permissions 664 including directories hence
> making them inaccessible. With this is could run chmod -R -d 775 644 foo/
> and give the directories the permissions 775.
chmod -R ug=rwX,o=rX is pretty close to what you're asking for. The only
difference is that the X also adds x permission to files that already have at
least one x bit.
Your suggestion is more generalized, so no necessarily a bad idea. I just
mention this because lots of people overlook the +X option.
--
Alan Curry