Unix and Linux Discussions Tagged with new file |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
1 |
7,792 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
4,326 |
Shell Programming and Scripting |
|
|
|
2 |
2,525 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
3,392 |
Shell Programming and Scripting |
|
|
|
2 |
6,122 |
UNIX for Dummies Questions & Answers |
|
|
|
12 |
22,281 |
Shell Programming and Scripting |
|
|
|
4 |
15,729 |
Shell Programming and Scripting |
|
|
|
2 |
13,027 |
Linux |
|
|
|
1 |
1,774 |
Shell Programming and Scripting |
|
|
|
0 |
1,515 |
Software Releases - RSS News |
|
|
|
3 |
3,076 |
Shell Programming and Scripting |
|
|
|
1 |
7,917 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
2,329 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
1,759 |
Programming |
|
|
|
4 |
26,875 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
2,615 |
Shell Programming and Scripting |
|
|
|
4 |
3,993 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
3,505 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
5,133 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
23,441 |
UNIX for Dummies Questions & Answers |
|
|
|
21 |
11,960 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
15,375 |
Programming |
|
|
|
4 |
3,969 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
4,327 |
Programming |
|
|
|
1 |
4,769 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,351 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,475 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
18,770 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
6,174 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
8,330 |
Cybersecurity |
|
|
|
2 |
6,299 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
2,751 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
70,497 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
2,314 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,222 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
2,281 |
UNIX for Dummies Questions & Answers |
CHMOD(1) General Commands Manual CHMOD(1)
NAME
chmod - change mode
SYNOPSIS
chmod [ -Rf ] mode file ...
DESCRIPTION
The mode of each named file is changed according to mode, which may be absolute or symbolic. An absolute mode is an octal number con-
structed from the OR of the following modes:
4000 set user ID on execution
2000 set group ID on execution
1000 sticky bit, see chmod(2)
0400 read by owner
0200 write by owner
0100 execute (search in directory) by owner
0070 read, write, execute (search) by group
0007 read, write, execute (search) by others
A symbolic mode has the form:
[who] op permission [op permission] ...
The who part is a combination of the letters u (for user's permissions), g (group) and o (other). The letter a stands for all, or ugo. If
who is omitted, the default is a but the setting of the file creation mask (see umask(2)) is taken into account.
Op can be + to add permission to the file's mode, - to take away permission and = to assign permission absolutely (all other bits will be
reset).
Permission is any combination of the letters r (read), w (write), x (execute), X (set execute only if file is a directory or some other
execute bit is set), s (set owner or group id) and t (save text - sticky). Letters u, g, or o indicate that permission is to be taken from
the current mode. Omitting permission is only useful with = to take away all permissions.
When the -R option is given, chmod recursively descends its directory arguments setting the mode for each file as described above. When
symbolic links are encountered, their mode is not changed and they are not traversed.
If the -f option is given, chmod will not complain if it fails to change the mode on a file.
EXAMPLES
The first example denies write permission to others, the second makes a file executable by all if it is executable by anyone:
chmod o-w file
chmod +X file
Multiple symbolic modes separated by commas may be given. Operations are performed in the order specified. The letter s is only useful
with u or g.
Only the owner of a file (or the super-user) may change its mode.
SEE ALSO
ls(1), chmod(2), stat(2), umask(2), chown(8)
7th Edition May 22, 1986 CHMOD(1)