Files
oldlinux-files/docs/Install-Guide/install-guide-2.2.2/node126.html
2024-02-19 00:23:35 -05:00

97 lines
5.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Converted with LaTeX2HTML 95.1 (Fri Jan 20 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
<HEAD>
<TITLE>3.9.2 Interpreting file permissions</TITLE>
</HEAD>
<BODY>
<meta name="description" value="3.9.2 Interpreting file permissions">
<meta name="keywords" value="gs">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<BR> <HR><A NAME=tex2html3352 HREF="node127.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html3350 HREF="node124.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html3344 HREF="node125.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html3354 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html3355 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html3353 HREF="node127.html">3.9.3 Dependencies</A>
<B>Up:</B> <A NAME=tex2html3351 HREF="node124.html">3.9 File Permissions</A>
<B> Previous:</B> <A NAME=tex2html3345 HREF="node125.html">3.9.1 Concepts of file </A>
<BR> <HR> <P>
<H2><A NAME=SECTION00592000000000000000>3.9.2 Interpreting file permissions</A></H2>
<P>
<A NAME=3200>&#160;</A>
<A NAME=3201>&#160;</A>
<A NAME=3283>&#160;</A>
<A NAME=3284>&#160;</A>
Let's look at an example to demonstrate file permissions. Using the
<tt>ls</tt> command with the <tt>-l</tt> option will display a ``long''
listing of the file, including file permissions.
<P><TT> /home/larry/foo# <em>ls -l stuff</em>
<PRE>-rw-r--r-- 1 larry users 505 Mar 13 19:05 stuff
</PRE>
/home/larry/foo#
<P></TT>
<P>
The first field printed in the listing represents the file permissions.
The third field is the owner of the file (<tt>larry</tt>), and the fourth
field is the group to which the file belongs (<tt>users</tt>). Obviously,
the last field is the name of the file (<tt>stuff</tt>), and we'll cover the
other fields later.
<P>
This file is owned by <tt>larry</tt>, and belongs to the group <tt>users</tt>.
Let's look at the file permissions. The string <tt>-rw-r--r--</tt> lists,
in order, the permissions granted to the file's owner, the file's group,
and everybody else.
<P>
The first character of the permissions string (``<tt>-</tt>'') represents the
type of file. A ``<tt>-</tt>'' just means that this is a regular file (as
opposed to a directory or device driver). The next three letters
(``<tt>rw-</tt>'') represent the permissions granted to the file's owner,
<tt>larry</tt>. The ``<tt>r</tt>'' stands for ``read'' and the ``<tt>w</tt>''
stands for ``write''. Thus, <tt>larry</tt> has read and write permission
to the file <tt>stuff</tt>.
<P>
As we mentioned, besides read and write permission, there is also
``execute'' permission---represented by an ``<tt>x</tt>''. However, there
is a ``<tt>-</tt>'' here in place of the ``<tt>x</tt>'', so Larry doesn't
have execute permission on this file. This is fine, the file <tt>stuff</tt>
isn't a program of any kind. Of course, because Larry owns the file,
he may grant himself execute permission for the file if he so desires.
This will be covered shortly.
<P>
The next three characters, <tt>r--</tt>, represent the group's permissions
on the file. The group which owns this file is <tt>users</tt>. Because
only an ``<tt>r</tt>'' appears here, any user which belongs to the group
<tt>users</tt> may read this file.
<P>
The last three characters, also <tt>r--</tt>, represent the permissions
granted to every other user on the system (other than the owner of the
file and those in the group <tt>users</tt>). Again, because only an
``<tt>r</tt>'' is present, other users may read the file, but not write to
it or execute it.
<P>
Here are some other examples of group permissions.
<DL COMPACT><DT><tt>-rwxr-xr-x</tt>
<DD>
The owner of the file may
read, write, and execute the file. Users in the file's group, and all other
users, may read and execute the file.
<P>
<DT><tt>-rw-------</tt>
<DD>
The owner of the file may
read and write the file. No other user can access the file.
<P>
<DT><tt>-rwxrwxrwx</tt>
<DD>
All users may read, write, and execute the file.
<P>
</DL><BR> <HR><A NAME=tex2html3352 HREF="node127.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html3350 HREF="node124.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html3344 HREF="node125.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html3354 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html3355 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html3353 HREF="node127.html">3.9.3 Dependencies</A>
<B>Up:</B> <A NAME=tex2html3351 HREF="node124.html">3.9 File Permissions</A>
<B> Previous:</B> <A NAME=tex2html3345 HREF="node125.html">3.9.1 Concepts of file </A>
<BR> <HR> <P>
<BR> <HR>
<P><ADDRESS>
<I>Matt Welsh <BR>
mdw@sunsite.unc.edu</I>
</ADDRESS>
</BODY>