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
