Recursively chmod permissions of only files in linux
So, you want to change the Linux permissions of all files in a directory and all sub directories, but not affect the permissions of the folders?
This simple guide will show you how to do a recursive chmod changing only the permissions of files, while leaving the permissions for all directories untouched.
The recursive chmod-files-only syntax:
The following shell command will chmod all files only (and ignore the directories) setting the permissions to 644.
The ” . ” specifies the directory. You may replace it with:
– denoting the current working directory.
– specifying the full literal directory.
With your modified command now ready for implementation, the files now sit helplessly trembling awaiting to be pwnd chowned.
Now that you’ve chowned some files, what are you going to be doing with all those directories?
Guide to Chmod Permissions of Only Directories in Linux.
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.















How do I do this on an FTP connection?
@Calvin Mitchell,
As There is no actual recursive command built into the File Transfer Protocol, this would be something purely dependent on your FTP Client, if it supports this feature or not. You will need to read into each of the FTP client applications you are interested in using, and look to see if they can locally initiate a recursive chmod, by browsing into each directory and sub directory you specify, and change the permissions as you designate. Unfortunately it will not offer the same flexibility or full control as shell access would. If possible, get remote shell access, if you feel comfortable with it, and utilize that to issue the commands in this guide.