chmod – change file mode bits

ABOUT chmod

In Unix and Unix-like operating systems, chmod is the command and system call which is used to change the access permissions of file system objects (files and directories). It is also used to change special mode flags. The request is filtered by the umask. The name is an abbreviation of change mode.[1]


$ chmod +t source/
$ ls -l
total 12
drwxr-xr-x 2 ahiliation ahiliation 4096 2010-03-13 04:40 Desktop
drwxr-xr-x 2 ahiliation ahiliation 4096 2010-03-13 19:20 Downloads
drwxr-xr-t 2 ahiliation ahiliation 4096 2010-03-13 20:41 source
t - Save text attribute (sticky bit) - The user may delete or modify only those files in the directory that they own or have write permission for.
$chmod -c
$ls -l rwsem.c
-rw-rw-r-- 1 root root 21007 Aug 30  2011 rwsem.c
$chmod -c rwsem.c
chmod: missing operand after ‘rwsem.c’
Try 'chmod --help' for more information.
$chmod -c
chmod: missing operand
Try 'chmod --help' for more information.
$chmod -c 700  rwsem.c
chmod: changing permissions of ‘rwsem.c’: Operation not permitted
$sudo chmod -c 700  rwsem.c
mode of ‘rwsem.c’ changed from 0664 (rw-rw-r--) to 0700 (rwx------)



Leave a Reply

Your email address will not be published. Required fields are marked *