Pages

Tuesday, April 1, 2008

Fun with chmod

To carefully add permissions to files in a directory tree, keep capital letters in mind.

The following is dangerous:
chmod -R a+x directoryname


That would give execute permissions to all files underneath directoryname.

To give execute permissions to only files that currently have execute permissions use:
chmod -R a+X directoryname


That would give execute permissions to only those files that already have some other execute permission -- great for allowing others to look in directories.

Fun.

No comments: