If you are not the owner of the file or directory, become superuser.
Only the current owner or superuser can use the chmod command to change file permissions on a file or directory.
Change permissions in symbolic mode by using the chmod command.
$ chmod who operator permission filename |
who operator permission |
who specifies whose permissions are changed, operator specifies the operation to perform, and permission specifies what permissions are changed. See Table 51-6 for the list of valid symbols. |
filename |
Is the file or directory. |
Verify the permissions of the file have changed.
$ ls -l filename |
The following example takes away read permission from others.
$ chmod o-r filea |
The following example adds read and execute permissions for user, group, and others.
$ chmod a+rx fileb |
The following example assigns read, write, and execute permissions to group.
$ chmod g=rwx filec |