LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   CHMOD directories.sub-directories.files (https://www.linuxquestions.org/questions/linux-software-2/chmod-directories-sub-directories-files-384695/)

zerojosh 11-19-2005 02:53 PM

CHMOD directories.sub-directories.files
 
I recently migrated a bunch of files from a windows partition to a linux partition; these all became ownership of root, allowing no other users to access to the files. Is there a way to CHMOD these directories, sub-directories, and files without having to go through every single folder and file? I'm looking at at least 500 folders with 10,000 files... surely there must be a more efficient way of doing this.

Does anyone know how? All the references I have read explain CHMOD only by giving examples with individual files. Thanks!

GrueMaster 11-19-2005 03:16 PM

Here is three programs you can use:

Chmod # Changes file/folder permissions (as you already seem to know)
chown # Changes file/folder user ownership
chgrp # Changes file/folder group ownership

All three of these programs can use "-R" to change fils/folders recursively. Use "-f" to just do it without prompting or error warning.

So, to enable write permissions to a directory and everything below it, use:
chmod -Rf +w <dir>

To Change ownership:
chown -Rf <user> <directory

And to change group:
chgrp -Rf <group> <dir>

Hope this helps.

zerojosh 11-19-2005 03:22 PM

Thanks!
 
Thank you so much, it worked on everything I had in only a few seconds.

Thanks again!


All times are GMT -5. The time now is 11:17 PM.