How can I change all the file permissions of a directory in one command in Unix?
feedback
|
migrated from stackoverflow.com Nov 8 '10 at 17:56
This question came from our site for professional and enthusiast programmers.
|
| |||||||
feedback
|
|
To change permissions on a file or directory entry non-recursively, use the
To change the owner of a file/directory recursively (affecting all descendants):
To change permissions bits of all files in a directory, recursively:
To change permissions bits of all directories:
It would be nice if you could just do this:
However, this has problems. It treats files and directories the same. The above command makes directories listable and readable by all users, but it also makes all files executable, which is usually what you do not want to do. If we change it to
The problem is that The point is, | |||||||
feedback
|
|
Do the following on a parent directory. chmod xxx /thedirectory Where xxx is the permissions you want to assign. And /thedirectory is the path to the directory. | |||||
feedback
|