1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324
|
<!--startcut ==============================================-->
<!-- *** BEGIN HTML header *** -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD>
<title>A Brief History of the 'ls' command LG #48</title>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000">
<!-- *** END HTML header *** -->
<!-- *** BEGIN navbar *** -->
<A HREF="lg_toc48.html"><IMG ALT="[ Table of Contents ]"
SRC="../gx/indexnew.gif" WIDTH=163 HEIGHT=60 ALIGN=bottom ></A>
<A HREF="../lg_frontpage.html"><IMG ALT="[ Front Page ]"
SRC="../gx/homenew.gif" WIDTH=163 HEIGHT=60 ALIGN=bottom></A>
<A HREF="dellomodarme.html"><IMG ALT="[ Prev ]" SRC="../gx/back2.gif" WIDTH=41 HEIGHT=60 ALIGN=bottom></A>
<A HREF="../lg_faq.html"><IMG ALT="[ Linux Gazette FAQ ]"
SRC="./../gx/dennis/faq.gif"WIDTH=163 HEIGHT=60 ALIGN=bottom></A>
<A HREF="fisher.html"><IMG ALT="[ Next ]" SRC="../gx/fwd.gif" WIDTH=41 HEIGHT=60 ALIGN=bottom ></A>
<!-- *** END navbar *** -->
<!--endcut ============================================================-->
<H4>
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <HR> <P>
<!--===================================================================-->
<center>
<H1><font color="maroon">A Brief History of the 'ls' command</font></H1>
<H4>By <a href="mailto:enf@pobox.com">Eric Fischer</a></H4>
</center>
<P> <HR> <P>
<!-- END header -->
The <tt>ls</tt> command, which lists files,
is one of the most essential
utilities for Unix and Linux users and, not surprisingly, one of the
oldest. In its earliest form it was called <tt>listf</tt>
and was available
on the Massachusetts Institute of Technology's Compatible Time Sharing
System (CTSS) by July, 1961. By 1963, there were a few options that could be
used to vary what <tt>listf</tt> would list:
<p>
<table>
<tr>
<td><tt>listf</tt></td>
<td>list files, newest first</td>
</tr>
<tr>
<td><tt>listf rev</tt></td>
<td>list files, oldest first</td>
</tr>
<tr>
<td><tt>listf</tt> <i>file</i> <i>extension</i></td>
<td>give information about the named file</td>
</tr>
<tr>
<td><tt>listf</tt> <i>month</i> <i>day</i> <i>year</i></td>
<td>list files older than the given date</td>
</tr>
</table>
<p>
In 1965, listf was extended to recognize ``<tt>*</tt>'' as a way to list all
files that matched a specific pattern, with further improvements to
the pattern matching in an updated version dated January 3, 1966.
The 1966 version also generalized the syntax and added lots of
options, including:
<p>
<table>
<tr>
<td><tt>listf (file)</tt></td>
<td>list only files, not links</td>
</tr>
<tr>
<td><tt>listf (auth)</tt> <i>user</i></td>
<td>list files created by the given user</td>
</tr>
<tr>
<td><tt>listf (made)</tt> <i>mmddyy</i> [<i>mmddyy</i>]</td>
<td>list files created between the given dates</td>
</tr>
<tr>
<td><tt>listf (srec)</tt></td>
<td>list by size</td>
</tr>
<tr>
<td><tt>listf (smad)</tt></td>
<td>list by date of last modification</td>
</tr>
<tr>
<td><tt>listf (rev)</tt></td>
<td>list in reverse order</td>
</tr>
<tr>
<td><tt>listf (long)</tt></td>
<td>list in long format</td>
</tr>
</table>
<p>
When CTSS was superseded by Multics, the <tt>listf</tt> command
was renamed to <tt>list</tt>, which could optionally be
abbreviated to <tt>ls</tt>. The early version of
<tt>ls</tt> had fewer options than late versions of
<tt>listf</tt> had, but still included, along with a few others:
<p>
<table>
<tr>
<td><tt>list -all</tt></td>
<td>(<tt>ls -a</tt>)</td>
<td>list everything</td>
</tr>
<tr>
<td><tt>list -date_time_modified</tt></td>
<td>(<tt>ls -dtm</tt>)</td>
<td>list by date of last modification</td>
</tr>
<tr>
<td><tt>list -reverse</tt></td>
<td>(<tt>ls -rv</tt>)</td>
<td>list in reverse order</td>
</tr>
</table>
<p>
When Bell Labs dropped out of Multics development in 1969 and work began on
Unix, only the abbreviated name of <tt>list</tt>, <tt>ls</tt>, was
retained. The First Edition (November 3, 1971) Unix manual documented
the following options for <tt>ls</tt>, all of which are still available today:
<p>
<table>
<tr>
<td><tt>ls -l </tt></td>
<td>list in long format</td>
</tr>
<tr>
<td><tt>ls -t</tt></td>
<td>sort by time modified</td>
</tr>
<tr>
<td><tt>ls -a</tt></td>
<td>list everything, including names starting with `<tt>.</tt>'</td>
</tr>
<tr>
<td><tt>ls -s</tt></td>
<td>include the size of files in the listing</td>
</tr>
<tr>
<td><tt>ls -d</tt></td>
<td>list directories' names, not their contents</td>
</tr>
</table>
<p>
By the Fifth Edition (manual page dated March 20, 1974) the list of
options for <tt>ls</tt> had expanded to include:
<p>
<table>
<tr>
<td><tt>ls -r </tt></td>
<td>list in reverse order</td>
</tr>
<tr>
<td><tt>ls -u</tt></td>
<td>use access time, not modification time</td>
</tr>
<tr>
<td><tt>ls -i</tt></td>
<td>list i-number for each file</td>
</tr>
<tr>
<td><tt>ls -f</tt></td>
<td>don't sort the listing at all</td>
</tr>
</table>
<p>
The Sixth Edition (May, 1975) added one more:
<p>
<table>
<tr>
<td><tt>ls -g </tt></td>
<td>list group IDs in the long format listing</td>
</tr>
</table>
<p>
In May and August, 1977, Bill Joy made some modifications of his own to
<tt>ls</tt> at the University of California, Berkeley, which he
subsequently distributed as part of the First Berkeley Software
Distribution, 1BSD. The most dramatic difference with this version of
<tt>ls</tt> was that it listed files in multiple columns rather than
only listing one name per line. The options to control this new format
were:
<p>
<table>
<tr>
<td><tt>ls -1 </tt></td>
<td>list one name per line (no columns)</td>
</tr>
<tr>
<td><tt>ls -c</tt></td>
<td>list in columns</td>
</tr>
<tr>
<td><tt>ls -x</tt></td>
<td>list in columns, but sort across, not down</td>
</tr>
<tr>
<td><tt>ls -q</tt></td>
<td>show control characters as `<tt>?</tt>'</td>
</tr>
<tr>
<td><tt>ls -m</tt></td>
<td>everything on one line, separated by commas</td>
</tr>
</table>
<p>
There was some controversy over whether it was appropriate to
include code to print in columns as an integral part of <tt>ls</tt>
or whether
instead the formatting into columns should be done by a separate program
into which the output of <tt>ls</tt> (or any other program) could be piped.
<p>
At the beginning of 1979, Bell Labs released Seventh Edition Unix. Its
version of <tt>ls</tt> did not incorporate the controversial changes,
and had one new option
that conflicted with a letter that Joy had also used:
<p>
<table>
<tr>
<td><tt>ls -c </tt></td>
<td>use inode change time, not modification time</td>
</tr>
</table>
<p>
A new Berkeley version of <tt>ls</tt>, dated August 26, 1980 and released with
4.0BSD, resolved the conflict by capitalizing the option to list in
columns: <tt>ls -C</tt>. It also added to what the manual was
by this time calling ``an unbelievable number of options:''
<p>
<table>
<tr>
<td><tt>ls -F </tt></td>
<td>mark directories with `<tt>/</tt>', programs with `<tt>*</tt>'</td>
</tr>
<tr>
<td><tt>ls -R</tt></td>
<td>recursively list subdirectories</td>
</tr>
<tr>
<td><tt>ls -b</tt></td>
<td>show control characters as their ASCII codes</td>
</tr>
</table>
<p>
Another revision in 4.2BSD (July 28, 1983) removed the <tt>-m</tt>,
<tt>-b</tt>, and <tt>-x</tt>
options -- but not before System V Release 2 had added all three of these
to its own repertoire of options.
They temporarily stayed alive there, but
none of the three survived POSIX standardization
so the 4.2BSD version of <tt>ls</tt> is essentially <tt>ls</tt>
as we know it today.
<!-- *** BEGIN copyright *** -->
<P> <hr> <P>
<H5 ALIGN=center>
Copyright © 1999, Eric Fischer<BR>
Published in Issue 48 of <i>Linux Gazette</i>, December 1999</H5>
<!-- *** END copyright *** -->
<!--startcut ==========================================================-->
<P> <HR> <P>
<!-- *** BEGIN navbar *** -->
<A HREF="lg_toc48.html"><IMG ALT="[ Table of Contents ]"
SRC="../gx/indexnew.gif" WIDTH=163 HEIGHT=60 ALIGN=bottom ></A>
<A HREF="../lg_frontpage.html"><IMG ALT="[ Front Page ]"
SRC="../gx/homenew.gif" WIDTH=163 HEIGHT=60 ALIGN=bottom></A>
<A HREF="dellomodarme.html"><IMG ALT="[ Prev ]" SRC="../gx/back2.gif" WIDTH=41 HEIGHT=60 ALIGN=bottom></A>
<A HREF="../lg_faq.html"><IMG ALT="[ Linux Gazette FAQ ]"
SRC="./../gx/dennis/faq.gif"WIDTH=163 HEIGHT=60 ALIGN=bottom></A>
<A HREF="fisher.html"><IMG ALT="[ Next ]" SRC="../gx/fwd.gif" WIDTH=41 HEIGHT=60 ALIGN=bottom ></A>
<!-- *** END navbar *** -->
</BODY></HTML>
<!--endcut ============================================================-->
|