chown question for subdirectories
I have a directory structure and files I wish to change permissions on, but I don't want to change permissions on every file/subfolder along the way. Example: I want to chown all files in dir4 where my directory struture is:
/dir1/dir2/dir3/dir4/* However, both dir3 and dir4 are owned by root:root so I need to change the ownership on those directories as well. But, if I do: chown -R user:group /dir1/dir2/dir3/dir4/ ...it will indeed make dir4 and it's files accessible, but it doesn't change dir3 - so folks still can't get to the files they need. I thought about doing: chown -R user:group /dir1/dir2/dir3* ... but that will give users access not only to dir4 and it's files, but any other files under dir3 which I don't want. My work around has been to do a chown on /dir1/dir2/dir3 and then a second chown on /dir1/dir2/dir3/dir4/, but I am thinking there has to be a way to do what I want in a single chown command - right? |
You need to use the chown command only on dir4 and its contents. For dir1, dir2,and dir3 you need to leave the ownership with root but change the permissions on those directories to 755 using the chmod command. But do not change the permissions on the contents of dir1, dir2, and dir3.
------------------- Steve Stites |
Quote:
|
All times are GMT -5. The time now is 09:01 AM. |