blob: e5ed5566e66fee3784fc37314aa3d5106de302b4 [file] [log] [blame]
<head>
<title>ls(1) - Plan 9 from User Space</title>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
</head>
<body bgcolor=#ffffff>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=10><td>
<tr><td width=20><td>
<tr><td width=20><td><b>LS(1)</b><td align=right><b>LS(1)</b>
<tr><td width=20><td colspan=2>
<br>
<p><font size=+1><b>NAME </b></font><br>
<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
ls, lc &ndash; list contents of directory<br>
</table>
<p><font size=+1><b>SYNOPSIS </b></font><br>
<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
<tt><font size=+1>ls</font></tt> [ <tt><font size=+1>&#8722;dlmnpqrstuFQ</font></tt> ] <i>name ...
<table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
</i>
<tt><font size=+1>lc</font></tt> [ <tt><font size=+1>&#8722;dlmnpqrstuFQ</font></tt> ] <i>name ...<br>
</i>
</table>
<p><font size=+1><b>DESCRIPTION </b></font><br>
<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
For each directory argument, <i>ls</i> lists the contents of the directory;
for each file argument, <i>ls</i> repeats its name and any other information
requested. When no argument is given, the current directory is
listed. By default, the output is sorted alphabetically by name.
<table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
<i>Lc</i> is the same as <i>ls</i>, but sets the <tt><font size=+1>&#8722;p</font></tt> option and pipes the output
through <a href="../man1/mc.html"><i>mc</i>(1)</a>.
<table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
There are a number of options:<br>
<tt><font size=+1>&#8722;d</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;If argument is a directory, list it, not its contents.<br>
<tt><font size=+1>&#8722;l</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;List in long format, giving mode (see below), file system type
(e.g., for devices, the <tt><font size=+1>#</font></tt> code letter that names it; see <a href="../man3/intro.html"><i>intro</i>(3)</a>),
the instance or subdevice number, owner, group, size in bytes,
and time of last modification for each file.<br>
<tt><font size=+1>&#8722;m</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;List the name of the user who most recently modified the file.<br>
<tt><font size=+1>&#8722;n</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;Don&#8217;t sort the listing.<br>
<tt><font size=+1>&#8722;p</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;Print only the final path element of each file name.<br>
<tt><font size=+1>&#8722;q</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;List the <i>qid</i> (see <a href="../man3/stat.html"><i>stat</i>(3)</a>) of each file; the printed fields
are in the order path, version, and type.<br>
<tt><font size=+1>&#8722;r</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;Reverse the order of sort.<br>
<tt><font size=+1>&#8722;s</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;Give size in Kbytes for each entry.<br>
<tt><font size=+1>&#8722;t</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;Sort by time modified (latest first) instead of by name.<br>
<tt><font size=+1>&#8722;u</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;Under <tt><font size=+1>&#8722;t</font></tt> sort by time of last access; under <tt><font size=+1>&#8722;l</font></tt> print time of
last access.<br>
<tt><font size=+1>&#8722;F</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;Add the character <tt><font size=+1>/</font></tt> after all directory names and the character
<tt><font size=+1>*</font></tt> after all executable files.<br>
<tt><font size=+1>&#8722;L</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;Print the character <tt><font size=+1>t</font></tt> before each file if it has the temporary
flag set, and <tt><font size=+1>&#8722;</font></tt> otherwise.<br>
<tt><font size=+1>&#8722;Q</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;By default, printed file names are quoted if they contain characters
special to <a href="../man1/rc.html"><i>rc</i>(1)</a>. The <tt><font size=+1>&#8722;Q</font></tt> flag disables this behavior.
<table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
The mode printed under the <tt><font size=+1>&#8722;l</font></tt> option contains 11 characters, interpreted
as follows: the first character is<br>
<tt><font size=+1>d</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if the entry is a directory;<br>
<tt><font size=+1>a</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if the entry is an append-only file;<br>
<tt><font size=+1>&#8722;</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if the entry is a plain file.
<table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
The next letter is <tt><font size=+1>l</font></tt> if the file is exclusive access (one writer
or reader at a time).
<table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
The last 9 characters are interpreted as three sets of three bits
each. The first set refers to owner permissions; the next to permissions
to others in the same user-group; and the last to all others.
Within each set the three characters indicate permission respectively
to read, to write, or to execute the file as a program.
For a directory, &#8216;execute&#8217; permission is interpreted to mean permission
to search the directory for a specified file. The permissions
are indicated as follows:<br>
<tt><font size=+1>r</font></tt>if the file is readable;<br>
<tt><font size=+1>w</font></tt>if the file is writable;<br>
<tt><font size=+1>x</font></tt>if the file is executable;<br>
<tt><font size=+1>&#8722;</font></tt>if none of the above permissions is granted.<br>
</table>
<p><font size=+1><b>SOURCE </b></font><br>
<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
<tt><font size=+1>/usr/local/plan9/src/cmd/ls.c<br>
/usr/local/plan9/bin/lc<br>
</font></tt>
</table>
<p><font size=+1><b>SEE ALSO </b></font><br>
<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
<a href="../man3/stat.html"><i>stat</i>(3)</a>, <a href="../man1/mc.html"><i>mc</i>(1)</a><br>
</table>
<td width=20>
<tr height=20><td>
</table>
<!-- TRAILER -->
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr height=15><td width=10><td><td width=10>
<tr><td><td>
<center>
<a href="../../"><img src="../../dist/spaceglenda100.png" alt="Space Glenda" border=1></a>
</center>
</table>
<!-- TRAILER -->
</body></html>