LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   chmod ,chown ,chgrp------------ (https://www.linuxquestions.org/questions/linux-newbie-8/chmod-chown-chgrp-295378/)

pal 02-27-2005 01:40 AM

chmod ,chown ,chgrp------------
 
hello sir, We are not able to implement the commands chown,chmod ,chgrp.May be we are not aware of these properly.Kindly help us.
We are giving an example-----
The users test1 , test2, test3 are under group( named group1) .
The users test4 , test5 ,test6 are under group ( named group2).
Now with chmod command if we give
# chmod -R 770 test2
Then it means the group ( to which user test2 belongs to) will also have all permissions . So if we login as test1 ,we should access all the files of test2 user.But in the home directory of user test1 ,these files are not there.
Similarily if we issue the command
# chmod -R 777 test2
Then the group2 members should also access the files of user test2.But it is not happening.

------------
now we will consider chown command.
if we have one file named abc under test2 user then if we issue the command
# chown test1 /home/test2/abc
then the user test1 should be the owner of file abc.And this file should not be there under home directory of user test2.But it is not happening.
-------------------------
Now we will consider the command chgrp. If we issue the command
# chgrp group2 /home/test2/abc
Now the group2 members should have the access to file abc.But still this file is under the test2 .
we tried seeing some documents but we could not find it in detail.

jailbait 02-27-2005 02:49 PM

"Now with chmod command if we give
# chmod -R 770 test2
Then it means the group ( to which user test2 belongs to) will also have all permissions . "

chmod changes the permission of files and directories. It has no effect on group names or user names.

"if we have one file named abc under test2 user then if we issue the command
# chown test1 /home/test2/abc
then the user test1 should be the owner of file abc.And this file should not be there under home directory of user test2.But it is not happening."

chown does not move files. If you want to move the file abc to a different directory use the mv command.

"Now we will consider the command chgrp. If we issue the command
# chgrp group2 /home/test2/abc
Now the group2 members should have the access to file abc.But still this file is under the test2 ."

Yes, that is the way that the command is supposed to work. If you want to move the file abc to a different directory use the mv command.

------------------------
Steve Stites


All times are GMT -5. The time now is 11:56 AM.