LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Changing file permissions within a directory for all files. (https://www.linuxquestions.org/questions/linux-newbie-8/changing-file-permissions-within-a-directory-for-all-files-286758/)

cajunaggie 02-05-2005 09:10 PM

Changing file permissions within a directory for all files.
 
I have to harddrive paritions. The secondary one is owned by root. I copied the contents of my secondary to my primary. I need to change the owner and group for every file but there is about 1.5GB of stuff. Is there a way I can change the owner/group of all files within a given directory/folder through the shell or do I have to do them one at a time?

damicatz 02-05-2005 09:24 PM

Most commands support a recursive option that allows you to handle files and files in sub-directories.

For example, if you wanted to change the owner of a home directory and all it's file and subdirectories you would do the following

chown -R user:group /home/name/*

If you just want to change the ownership of files in one directory and not it's sub-directories you can leave out the -R

cajunaggie 02-06-2005 01:53 AM

Thank you ever so much!


All times are GMT -5. The time now is 02:10 PM.