While creating an account on Unix, it assigns a owner ID and a group ID to each user. All the permissions mentioned above are also assigned based on Owner and Groups.
Two commands are available to change the owner and the group of files:
- chown: The chown command stands for "change owner" and is used to change the owner of a file.
Syntaxchown [-R] newowner filenames
-R Change the permission on files that are in the subdirectories of the directory that you are currently in. newowner The alias/username of the new owner of the file. filenames The file that you are changing the rights to.
- chgrp: The chgrp command stands for "change group" and is used to change the group of a file.
The chrgp command changes the group ownership of a file. The basic syntax is as follows:[amrood]$ chgrp group filelist
The value of group can be the name of a group on the system or the group ID (GID) of a group on the system.Following example:[amrood]$ chgrp special testfile
No comments:
Post a Comment