Guide to Chmod Permissions of Only Directories in Linux
The chmod command in Linux is a very valuable and often necessary function for fixing permissions of directories and their contents on a publicly accessible server.
When you are needing to change linx octet permissions for many folders and child folders and their contents, the -R recursive switch is of great value, as it saves you the trouble of having to switch directories and execute the chmod command time and time again.
Unfortunately, chmod is only able to execute commands on input parameters passed along to it specifying matches in the file name, and whether or not to chmod recursively or not. If your desire is to only chmod directories, but not the files, you have a problem.
To bypass the chmod command limitation, we will be utilizing stdin to stdout capability of the find and chmod commands. Since find and chmod take advantage of standard input / standard output capability, we are able to have them cross communicate sequentially in order to selectively pass along files to be chmod’ed which match our find query. Continue Reading
