Saturday, 26 January 2019

linux - chmod 777: how to make all files become "RWX"


I want to change permission of each files in a directory. I've been using chmod 777 but its wasting time if I have 50 files.


How to make all files inside directory become rwx without change them one by one?



Answer



chmod -cR 777 *


Will change all the files including subdirectories recursively (R option) including subdirectories, but also report on when it makes a change (c option).


Rather than changing all the files with too wide permissions, you might want to change the ownership instead.


sudo chown -hR tomcat

The line above changes owndership to a tomcat application server, you need to figure out which user your webserver is using. You can easily see that by doing


ps aux

(The h option is for changing the owndership of a symbolic link if encountered, but not the files it linkes to)


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...