- Forums
- Linux
- Chmod Permissions To Files Only
If You Followed Our Previous Tutorial Guide About Changing The Directory Permissions Only In A Directory, But How About If You Dont Want To Change The Permissions To The Directories, But Rather To The Files Only. Well, You Can, Follow This Guide To Help [3291], Last Updated: Mon Jun 24, 2024
Webune Support
Sun Feb 07, 2010
0 Comments
401 Visits
Thanks for visiting Webune. if you followed our previous tutorial guide about changing the directory permissions only in a directory, but how about if you dont want to change the permissions to the directories, but rather to the files only. well, you can, follow this guide to help you...
Webune provides Dedicate Linux Server with Excellent Service and Support!!!
this post will show you how you can change permissions using chmod in unix/linux command in the shell for changing the permissions to a file or all files including sub-directories within another directory
if you are a Linux administrator or just starting to program in linux you will find this information helpful.
so lets start this tutorial
lets say in our example, we want to change the linux permissions from 775 (-rwxrwxr-x) to 644 (-rw-r--r--) to all the files in the downloads/ directory located at the following path:
/var/www/web/public_html/downloads/we can do it with just one command:
SHELL COMMAND:
find /var/www/web/public_html/downloads/ -type f -print0 |xargs -0 chmod 644
now when you list all the sub-directories and files, you will see that the permissions for all the files under
/var/www/web/public_html/downloads/ have been changed to 644, except the directories remain unchanged
hope that helps