Unix and Linux Discussions Tagged with chmod |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
4,900 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
3,807 |
Shell Programming and Scripting |
|
|
|
18 |
4,606 |
UNIX for Beginners Questions & Answers |
|
|
|
23 |
17,506 |
Shell Programming and Scripting |
|
|
|
12 |
5,221 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
9,420 |
Cybersecurity |
|
|
|
6 |
9,817 |
Shell Programming and Scripting |
|
|
|
1 |
1,841 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
10,856 |
Shell Programming and Scripting |
|
|
|
4 |
2,319 |
Shell Programming and Scripting |
|
|
|
2 |
40,201 |
Shell Programming and Scripting |
|
|
|
5 |
6,623 |
Shell Programming and Scripting |
|
|
|
2 |
6,863 |
Shell Programming and Scripting |
|
|
|
11 |
5,606 |
Shell Programming and Scripting |
|
|
|
6 |
335,162 |
Tips and Tutorials |
|
|
|
3 |
19,638 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
4,388 |
Web Development |
|
|
|
3 |
7,637 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
10,073 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
5,008 |
UNIX for Dummies Questions & Answers |
|
|
|
6 |
6,243 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
11,540 |
SuSE |
|
|
|
3 |
9,661 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
7,802 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
2,724 |
Shell Programming and Scripting |
|
|
|
1 |
7,419 |
Shell Programming and Scripting |
|
|
|
2 |
4,397 |
HP-UX |
|
|
|
1 |
4,394 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,479 |
Shell Programming and Scripting |
|
|
|
3 |
17,845 |
Solaris |
|
|
|
3 |
13,103 |
Solaris |
|
|
|
1 |
11,503 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
9,218 |
Shell Programming and Scripting |
|
|
|
2 |
10,969 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
2,872 |
Shell Programming and Scripting |
|
|
|
33 |
57,037 |
Shell Programming and Scripting |
|
|
|
5 |
13,491 |
Shell Programming and Scripting |
|
|
|
3 |
15,192 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
7,666 |
UNIX for Dummies Questions & Answers |
|
|
|
6 |
11,291 |
Cybersecurity |
CHMOD(1) General Commands Manual CHMOD(1)
NAME
chmod - change access mode for files
SYNOPSIS
chmod [-R] mode file ...
OPTIONS
-R Change hierarchies recursively
EXAMPLES
chmod 755 file # Owner: rwx Group: r-x Others: r-x
chmod +x file1 file2
# Make file1 and file2 executable
chmod a-w file # Make file read only
chmod u+s file # Turn on SETUID for file
chmod -R o+w dir # Allow writing for all files in dir
DESCRIPTION
The given mode is applied to each file in the file list. If the -R flag is present, the files in a directory will be changed as well. The
mode can be either absolute or symbolic. Absolute modes are given as an octal number that represents the new file mode. The mode bits are
defined as follows:
4000 Set effective user id on execution to file's owner id
2000 Set effective group id on execution to file's group id
0400 file is readable by the owner of the file
0200 writeable by owner
0100 executable by owner
0070 same as above, for other users in the same group
0007 same as above, for all other users
Symbolic modes modify the current file mode in a specified way. The form is:
[who] op permissions { op permissions ...} {, [who] op ... }
The possibilities for who are u, g, o, and a, standing for user, group, other and all, respectively. If who is omitted, a is assumed, but
the current umask is used. The op can be +, -, or =; + turns on the given permissions, - turns them off; = sets the permissions exclu-
sively for the given who. For example g=x sets the group permissions to --x.
The possible permissions are r, w, x; which stand for read, write, and execute; s turns on the set effective user/group id bits. s only
makes sense with u and g; o+s is harmless.
SEE ALSO
ls(1), chmod(2).
CHMOD(1)