The next nine spaces are divided into 3 sets of three as shown in Figure. The first set of three is the read, write, and execute permissions for the owner of the file. The second set of three is the read, write, and execute permissions for anyone who belongs to the user group for the file. The last set of permissions is for anyone who has a login to the system.
So its like owner permissions-group user permissions-anonymous user permission
Within each set of permissions, r stands for read, w stands for write, and x stands for execute. If the file is a script or command, you must have execute permission to run it. The execute permission is required to change into a directory. To change file permissions, you must be the owner of the file or directory or be the root user. The chmod utility is used to modify file permissions.
The basic syntax is as follows:
chmod [ugoa][+-=]
For the first argument, choose one or more letters ugoa, where u stands for the user who owns the file , g stands for everyone in the file’s group, o stands for other users not in the file’s group, and a stands for all users. The difference between specifying o and a is that o changes the third set of permissions for everyone and a changes the permissions for all three sets.
The second argument must be one of +, -, or =. If the plus sign (+) is used, the permissions that follow it are added for the users and groups provided by the first argument. If the minus sign (-) is used, the permissions that follow are removed for the users and groups in the first argument. However, if the equals sign (=) is used, the file will only have the permissions being specified (the existing permissions are overwritten and not retained).
The last argument is a filename or group of filenames on which you set the permissions. Multiple filenames can be listed using the * wildcard character such as *.txt for all files ending in .txt. The third argument
Post a Comment