.TH CHMOD 1 .SH NAME chmod \- change mode .SH SYNTAX .B chmod mode file ... .SH DESCRIPTION The mode of each named file is changed according to .I mode, which may be absolute or symbolic. An absolute .I mode is an octal number constructed from the OR of the following modes: .TP 10 4000 set user ID on execution .br .br .ns .TP 10 2000 set group ID on execution .br .br .ns .TP 10 1000 sticky bit, see \fIchmod\fP\|(2) .br .br .ns .TP 10 0400 read by owner .br .br .ns .TP 10 0200 write by owner .br .br .ns .TP 10 0100 execute (search in directory) by owner .br .br .ns .TP 10 0070 read, write, execute (search) by group .br .br .ns .TP 10 0007 read, write, execute (search) by others .PP A symbolic .I mode has the form: .IP .RI [ who ] .I op permission .RI [ "op permission" "] ..." .PP The .I who part is a combination of the letters .B u (for user's permissions), .B g (group) and .B o (other). The letter .B a stands for .B ugo. If .I who is omitted, the default is .I a but the setting of the file creation mask (see \fIumask\fP\|(2)) is taken into account. .PP .I Op can be '\fB+\fP' to add .I permission to the file's mode, '\fB-\fP' to take away .I permission and '\fB=\fP' to assign .I permission absolutely (all other bits will be reset). .PP .I Permission is any combination of the letters .B r (read), .B w (write), .B x (execute), .B s (set owner or group id) and .B t (save text \- sticky). The `sticky' bit can only be set by the super-user (see \fIchmod\fP\|(2)). Letters .BR u, .B g or .B o indicate that .I permission is to be taken from the current mode. Omitting .I permission is only useful with '\fB=\fP' to take away all permissions. .PP The first example denies write permission to others, the second makes a file executable: .IP \fBchmod o\-w file .br chmod +x file\fP .PP Multiple symbolic modes separated by commas may be given. Operations are performed in the order specified. The letter .B s is only useful with .B u or .B g. .PP Only the owner of a file (or the super-user) may change its mode. .SH "SEE ALSO" chown (1), ls(1), chmod(2), stat(2), umask(2)