124 lines
2.9 KiB
HTML
124 lines
2.9 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>chmod(1)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>chmod(1)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
chmod - change access mode for files
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>chmod</STRONG> <STRONG>[-R</STRONG>] <EM>mode</EM> <EM>file</EM> ...
|
|
|
|
|
|
</PRE>
|
|
<H2>OPTIONS</H2><PRE>
|
|
|
|
<STRONG>-R</STRONG> Change hierarchies recursively
|
|
|
|
|
|
</PRE>
|
|
<H2>EXAMPLES</H2><PRE>
|
|
|
|
<STRONG>chmod</STRONG> <STRONG>755</STRONG> <STRONG>file</STRONG> # Owner: rwx Group: r-x Others: r-x
|
|
|
|
<STRONG>chmod</STRONG> <STRONG>+x</STRONG> <STRONG>file1</STRONG> <STRONG>file2</STRONG>
|
|
# Make <EM>file1</EM> and <EM>file2</EM> executable
|
|
|
|
<STRONG>chmod</STRONG> <STRONG>a-w</STRONG> <STRONG>file</STRONG> # Make <EM>file</EM> read only
|
|
|
|
<STRONG>chmod</STRONG> <STRONG>u+s</STRONG> <STRONG>file</STRONG> # Turn on SETUID for <EM>file</EM>
|
|
|
|
<STRONG>chmod</STRONG> <STRONG>-R</STRONG> <STRONG>o+w</STRONG> <STRONG>dir</STRONG> # Allow writing for all files in dir
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
|
|
The given mode is applied to each file in the file list. If the <STRONG>-R</STRONG> 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 <EM>who</EM> are <EM>u</EM>, <EM>g</EM>, <EM>o</EM>, and <EM>a</EM>, standing for user, group,
|
|
other and all, respectively. If <EM>who</EM> is omitted, <EM>a</EM> is assumed, but the
|
|
current umask is used. The op can be +, -, or =; + turns on the given
|
|
permissions, - turns them off; = sets the permissions exclusively for the
|
|
given <EM>who</EM>. For example <EM>g</EM>=<EM>x</EM> sets the group permissions to --<EM>x</EM>.
|
|
|
|
The possible permissions are <EM>r</EM>, <EM>w</EM>, <EM>x</EM>; which stand for read, write, and
|
|
execute; <EM>s</EM> turns on the set effective user/group id bits. <EM>s</EM> only makes
|
|
sense with <EM>u</EM> and <EM>g</EM>; o+s is harmless.
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man1/ls.1.html">ls(1)</A></STRONG>, <STRONG><A HREF="../man2/chmod.2.html">chmod(2)</A></STRONG>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|