[X-Unix] need help with a command

Stroller MacMonster at myrealbox.com
Wed Mar 2 05:37:51 PST 2005


On Mar 2, 2005, at 11:41 am, Eugene wrote:

> ... Also,
> : sometimes it's best handling directories and non-directory files
> : separately when changing permissions, e.g. setting the 'x' (execute)
> : bit makes sense for directories but not for non-executable 
> traditional
> : Unix files.  So, you could construct two commands like:
> :
> :  find PATH -type d -not -name '~Archive' -exec chmod DIR-MODE {} \;
> :  find PATH -type f -exec chmod NONDIR-MODE {} \;
> :
> : ... for changing dirs and regular files separately.
>
> Or do it all at once?
>
> 	find PATH \(-type d -o -type f) -not \( -type d -a -name '~Archive' 
> \) -exec chmod MODE "{}" \;

That'll apply the same permissions to the directories as to the regular 
files. As Scott said, we want directories to have +xxx permissions, but 
not h4x0r.sh or tr0j4n.exe which got saved there by mistake.

Stroller.



More information about the X-Unix mailing list