LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I need to change access to over 5000 files in the same directory (https://www.linuxquestions.org/questions/linux-newbie-8/i-need-to-change-access-to-over-5000-files-in-the-same-directory-580770/)

cdom 08-29-2007 02:59 PM

I need to change access to over 5000 files in the same directory
 
I made the mistake of transfering all my audio files while in root. Now I have 5000 files and directories that I cannot access as a non-super-user. Is there a way to change the file permissions in one fell swoop instead of using chmod on every directory and file?

b0uncer 08-29-2007 03:01 PM

Yeah, recursive chmod'ing.
Code:

man chmod
after reading the important lines, which takes about 8 seconds, do this:
Code:

chmod -R new_owner /path/to/top/directory
and after that, /path/to/top/directory and all of it's subfolders and files are changed to the ownership of new_owner.

cdom 08-29-2007 03:50 PM

Thanks
 
I looked through the man file but obviously didn't understand it. Thanks so much.

i_grok 08-29-2007 03:51 PM

Actually, you want to change the owner of the files, not the permissions.

Code:

chown -R new_owner /path/to/top/directory


All times are GMT -5. The time now is 05:01 PM.