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 absolute mode by using the chmod command.
$ chmod nnn filename |
|
nnn |
Specifies the octal values that change permissions on the file or directory. See Table 51-5 for the list of valid octal values. |
|
filename |
File or directory. |
Verify the permissions of the file have changed.
$ ls -l filename |
The following example sets rwxr-xr-x permissions on myfile.
$ chmod 755 myfile $ ls -l myfile -rwxr-xr-x 1 kryten staff 6144 May 24 10:49 myfile |