How to Change File Permissions in Absolute Mode
In this procedure, a user changes permissions on a file that the user owns.
Example 1-4 Changing Permissions in Absolute Mode
In this example, the administrator changes the permissions of a directory that is open to the public from 744
(read, write, execute; read-only; and read-only) to 755
(read, write, execute; read and execute; and read and execute).
# ls -ld public_dir drwxr--r-- 1 jdoe staff 6K Aug 7 12:06 public_dir # chmod 755 public_dir # ls -ld public_dir drwxr-xr-x 1 jdoe staff 6K Aug 7 12:06 public_dir
In this example, the file owner changes the permissions of an executable shell script from read and write to read, write, and execute.
% ls -l my_script -rw------- 1 jdoe staff 6K Aug 7 12:06 my_script % chmod 700 my_script % ls -l my_script -rwx------ 1 jdoe staff 6K Aug 7 12:06 my_script