1 .\" Copyright (c) 1980, 1993 Regents of the University of California.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)title.urm 8.7 (Berkeley) 4/20/94
33 .\" $FreeBSD: src/share/man/man0/title.urm,v 1.7 1999/08/28 00:19:38 peter Exp $
34 .\" $DragonFly: src/share/man/man0/Attic/title.urm,v 1.2 2003/06/17 04:36:58 dillon Exp $
48 FreeBSD User's Reference Manual
58 This stiff doesn't really belong here...
59 The USENIX Association,
60 the UNIX and Advanced Computing Systems professional and technical organization,
61 is a not-for-profit membership association of individuals and
62 institutions with an interest in UNIX and UNIX-like systems,
63 and, by extension, C++, X Window System, and other programming tools.
66 fostering innovation and communicating research and technological developments,
68 sharing ideas and experience relevant to UNIX,
69 UNIX-related, and advanced computing systems, and
71 providing a neutral forum for the exercise of critical
72 thought and airing of technical issues.
74 USENIX publishes a journal (\fBComputing Systems\fP),
75 Conference and Workshop Proceedings, and a Book Series.
86 FreeBSD User's Reference Manual
90 For FreeBSD version 2.1
113 Copyright 1979, 1980, 1983, 1986, 1993
114 The Regents of the University of California. All rights reserved.
117 Other than the specific manual pages and documents listed below
118 as copyrighted by AT&T,
119 redistribution and use of this manual in source and binary forms,
120 with or without modification, are permitted provided that the
121 following conditions are met:
123 Redistributions of this manual must retain the copyright
124 notices on this page, this list of conditions and the following disclaimer.
126 Software or documentation that incorporates part of this manual must
127 reproduce the copyright notices on this page, this list of conditions and
128 the following disclaimer in the documentation and/or other materials
129 provided with the distribution.
131 All advertising materials mentioning features or use of this software
132 must display the following acknowledgement:
133 ``This product includes software developed by the University of
134 California, Berkeley and its contributors.''
136 Neither the name of the University nor the names of its contributors
137 may be used to endorse or promote products derived from this software
138 without specific prior written permission.
140 \fB\s-1THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
141 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
142 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
143 ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
144 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
145 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
146 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
147 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
148 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
149 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
153 The Institute of Electrical and Electronics Engineers and the American
154 National Standards Committee X3, on Information Processing Systems have
155 given us permission to reprint portions of their documentation.
158 In the following statement, the phrase ``this text'' refers to portions
159 of the system documentation.
161 ``Portions of this text are reprinted and reproduced in
162 electronic form in 4.4BSD from IEEE Std 1003.1-1988, IEEE
163 Standard Portable Operating System Interface for Computer Environments
164 (POSIX), copyright 1988 by the Institute of Electrical and Electronics
165 Engineers, Inc. In the event of any discrepancy between these versions
166 and the original IEEE Standard, the original IEEE Standard is the referee
170 In the following statement, the phrase ``This material'' refers to portions
171 of the system documentation.
173 ``This material is reproduced with permission from American National
174 Standards Committee X3, on Information Processing Systems. Computer and
175 Business Equipment Manufacturers Association (CBEMA), 311 First St., NW,
176 Suite 500, Washington, DC 20001-2178. The developmental work of
177 Programming Language C was completed by the X3J11 Technical Committee.''
180 The views and conclusions contained in this manual are those of the
181 authors and should not be interpreted as representing official policies,
182 either expressed or implied, of the Regents of the University of California.
185 This book was printed and bound in the United States of America.
193 \s+4\fBContents\fP\s-4
198 The Computer Systems Research Group, 1979\-1993 vii
201 List of Manual Pages xxiii
203 Reference Manual Sections 1, 6, 7 tabbed pages
204 List of Documents inside back cover
210 .\" The contributor list below is derived from the file that resides in
211 .\" vangogh:~admin/contrib/contrib:
213 .\" @(#)contrib 5.54 (Berkeley) 4/17/94
215 .\" This file should not be editted, rather the original contrib file
216 .\" should be used to recrete this one following the directions at its top.
217 .\" Contrib starts here and continues to the comment `END OF CONTRIB'.
223 \fBThe Computer Systems Research Group 1979 \- 1993\fP
230 \fBCSRG Technical Staff\fP
240 Marshall Kirk McKusick
247 \fBCSRG Administration and Support\fP
263 \fBOrganizations that funded the CSRG with grants,
264 gifts, personnel, and/or hardware.\fP
268 Center for Advanced Aviation System Development, The MITRE Corp.
269 Compaq Computer Corporation
271 Department of Defense Advance Research Projects Agency (DARPA)
272 Digital Equipment Corporation
273 The Hewlett-Packard Company
274 NASA Ames Research Center
275 The National Science Foundation
276 The Open Software Foundation
277 UUNET Technologies Inc.
284 \fBThe following are people and organizations that provided a
285 large subsystem for the BSD releases.\fP
289 ANSI C library Chris Torek
290 ANSI C prototypes Donn Seeley and John Kohl
291 Autoconfiguration Robert Elz
292 C library documentation American National Standards Committee X3
293 CCI 6/32 support Computer Consoles Inc.
294 DEC 3000/5000 support Ralph Campbell
295 Disklabels Symmetric Computer Systems
296 Documentation Cynthia Livingston and The USENIX Association
297 Franz Lisp Richard Fateman, John Foderaro, Keith Sklower, Kevin Layer
298 GCC, GDB The Free Software Foundation
299 Groff James Clark (The FSF)
300 HP300 support Jeff Forys, Mike Hibler, Jay Lepreau, Donn Seeley and the Systems
301 Programming Group; University of Utah Computer Science Department
303 Ingres Mike Stonebraker, Gene Wong, and the Berkeley Ingres Research Group
304 Intel 386/486 support Bill Jolitz and TeleMuse
306 Kerberos Project Athena and MIT
307 Kernel support Bill Shannon and Sun Microsystems Inc.
308 LFS Margo Seltzer, Mendel Rosenblum, Carl Staelin
309 MIPS support Trent Hein
310 Math library K.C. Ng, Zhishun Alex Liu, S. McDonald, P. Tang and W. Kahan
312 NFS automounter Jan-Simon Pendry
313 Network device drivers Micom-Interlan and Excelan
314 Omron Luna support Akito Fujita and Shigeto Mochida
316 RPC support Sun Microsystems Inc.
317 Shared library support Rob Gingell and Sun Microsystems Inc.
318 Sony News 3400 support Kazumasa Utashiro
319 Sparc I/II support Computer Systems Engineering Group, Lawrence Berkeley Laboratory
320 Stackable file systems John Heidemann
322 System documentation The Institute of Electrical and Electronics Engineers, Inc.
323 TCP/IP Rob Gurwitz and Bolt Beranek and Newman Inc.
324 Timezone support Arthur David Olson
325 Transport/Network OSI layers IBM Corporation and the University of Wisconsin
326 Kernel XNS assistance William Nesheim, J. Q. Johnson, Chris Torek, and James O'Toole
327 User level XNS Cornell University
328 VAX 3000 support Mt. Xinu and Tom Ferrin
329 VAX BI support Chris Torek
330 VAX device support Digital Equipment Corporation and Helge Skrivervik
331 Versatec printer/plotter support University of Toronto
332 Virtual memory implementation Avadis Tevanian, Jr., Michael Wayne Young,
333 and the Carnegie-Mellon University Mach project
334 X25 University of British Columbia
338 \fBThe following are people and organizations that provided a specific
339 item, program, library routine or program maintenance for the BSD system.
340 (Their contribution may not be part of the final 4.4BSD release.)\fP
348 386 device drivers Carnegie-Mellon University Mach project
349 386 device drivers Don Ahn, Sean Fagan and Tim Tucker
350 HCX device drivers Harris Corporation
351 Kernel enhancements Robert Elz, Peter Ivanov, Ian Johnstone, Piers Lauder,
352 John Lions, Tim Long, Chris Maltby, Greg Rose and John Wainwright
353 ISO-9660 filesystem Pace Willisson, Atsushi Murai
357 adventure(6) Don Woods log(3) Peter McIlroy
358 adventure(6) Jim Gillogly look(1) David Hitz
359 adventure(6) Will Crowther ls(1) Elan Amir
360 apply(1) Rob Pike ls(1) Michael Fischbein
361 ar(1) Hugh A. Smith lsearch(3) Roger L. Snyder
362 arithmetic(6) Eamonn McManus m4(1) Ozan Yigit
363 arp(8) Sun Microsystems Inc. mail(1) Kurt Schoens
364 at(1) Steve Wall make(1) Adam de Boor
365 atc(6) Ed James me(7) Eric Allman
366 awk(1) Arnold Robbins mergesort(3) Peter McIlroy
367 awk(1) David Trueman mh(1) Marshall Rose
368 backgammon(6) Alan Char mh(1) The Rand Corporation
369 banner(1) Mark Horton mille(6) Ken Arnold
370 battlestar(6) David Riggle mknod(8) Kevin Fall
371 bcd(6) Steve Hayman monop(6) Ken Arnold
372 bdes(1) Matt Bishop more(1) Eric Shienbrood
373 berknet(1) Eric Schmidt more(1) Mark Nudleman
374 bib(1) Dain Samples mountd(8) Herb Hasler
375 bib(1) Gary M. Levin mprof(1) Ben Zorn
376 bib(1) Timothy A. Budd msgs(1) David Wasley
377 bitstring(3) Paul Vixie multicast Stephen Deering
378 boggle(6) Barry Brachman mv(1) Ken Smith
379 bpf(4) Steven McCanne named/bind(8) Douglas Terry
380 btree(3) Mike Olson named/bind(8) Kevin Dunlap
381 byte-range locking Scooter Morris news(1) Rick Adams (and a cast of thousands)
382 caesar(6) John Eldridge nm(1) Hans Huebner
383 caesar(6) Stan King pascal(1) Kirk McKusick
384 cal(1) Kim Letkeman pascal(1) Peter Kessler
385 cat(1) Kevin Fall paste(1) Adam S. Moskowitz
386 chess(6) Stuart Cracraft (The FSF) patch(1) Larry Wall
387 ching(6) Guy Harris pax(1) Keith Muller
388 cksum(1) James W. Williams phantasia(6) C. Robertson
389 clri(8) Rich $alz phantasia(6) Edward A. Estes
390 col(1) Michael Rendell ping(8) Mike Muuss
391 comm(1) Case Larsen pom(6) Keith E. Brandt
392 compact(1) Colin L. McMaster pr(1) Keith Muller
393 compress(1) James A. Woods primes(6) Landon Curt Noll
394 compress(1) Joseph Orost qsort(3) Doug McIlroy
395 compress(1) Spencer Thomas qsort(3) Earl Cohen
396 courier(1) Eric Cooper qsort(3) Jon Bentley
397 cp(1) David Hitz quad(3) Chris Torek
398 cpio(1) AT&T quiz(6) Jim R. Oldroyd
399 crypt(3) Tom Truscott quiz(6) Keith Gabryelski
400 csh(1) Christos Zoulas radixsort(3) Dan Bernstein
401 csh(1) Len Shar radixsort(3) Peter McIlroy
402 curses(3) Elan Amir rain(6) Eric P. Scott
403 curses(3) Ken Arnold ranlib(1) Hugh A. Smith
404 cut(1) Adam S. Moskowitz rcs(1) Walter F. Tichy
405 cut(1) Marciano Pitargue rdist(1) Michael Cooper
406 dbx(1) Mark Linton regex(3) Henry Spencer
407 dd(1) Keith Muller robots(6) Ken Arnold
408 dd(1) Lance Visser rogue(6) Timothy C. Stoehr
409 des(1) Jim Gillogly rs(1) John Kunze
410 des(1) Phil Karn sail(6) David Riggle
411 des(1) Richard Outerbridge sail(6) Edward Wang
412 dipress(1) Xerox Corporation sccs(1) Eric Allman
413 disklabel(8) Symmetric Computer Systems scsiformat(1) Lawrence Berkeley Laboratory
414 du(1) Chris Newcomb sdb(1) Howard Katseff
415 dungeon(6) R.M. Supnik sed(1) Diomidis Spinellis
416 ed(1) Rodney Ruddock sendmail(8) Eric Allman
417 emacs(1) Richard Stallman setmode(3) Dave Borman
418 erf(3) Peter McIlroy, K.C. Ng sh(1) Kenneth Almquist
419 error(1) Robert R. Henry slattach(8) Rick Adams
420 ex(1) Mark Horton slip(8) Rick Adams
421 factor(6) Landon Curt Noll spms(1) Peter J. Nicklin
422 file(1) Ian Darwin strtod(3) David M. Gay
423 find(1) Cimarron Taylor swab(3) Jeffrey Mogul
424 finger(1) Tony Nardo sysconf(3) Sean Eric Fagan
425 fish(6) Muffy Barkocy sysline(1) J.K. Foderaro
426 fmt(1) Kurt Schoens syslog(3) Eric Allman
427 fnmatch(3) Guido van Rossum systat(1) Bill Reeves
428 fold(1) Kevin Ruddy systat(1) Robert Elz
429 fortune(6) Ken Arnold tail(1) Edward Sze-Tyan Wang
430 fpr(1) Robert Corbett talk(1) Clem Cole
431 fsdb(8) Computer Consoles Inc. talk(1) Kipp Hickman
432 fsplit(1) Asa Romberger talk(1) Peter Moore
433 fsplit(1) Jerry Berkman telnet(1) Dave Borman
434 gcc/groff integration UUNET Technologies, Inc. telnet(1) Paul Borman
435 gcore(1) Eric Cooper termcap(5) John A. Kunze
436 getcap(3) Casey Leedom termcap(5) Mark Horton
437 glob(3) Guido van Rossum test(1) Kenneth Almquist
438 gprof(1) Peter Kessler tetris(6) Chris Torek
439 gprof(1) Robert R. Henry tetris(6) Darren F. Provine
440 hack(6) Andries Brouwer (and a cast of thousands) timed(8) Riccardo Gusella
441 hangman(6) Ken Arnold timed(8) Stefano Zatti
442 hash(3) Margo Seltzer tn3270(1) Gregory Minshall
443 heapsort(3) Elmer Yglesias tr(1) Igor Belchinskiy
444 heapsort(3) Kevin Lew traceroute(8) Van Jacobson
445 heapsort(3) Ronnie Kon trek(6) Eric Allman
446 hunt(6) Conrad Huang tset(1) Eric Allman
447 hunt(6) Greg Couch tsort(1) Michael Rendell
448 icon(1) Bill Mitchell unifdef(1) Dave Yost
449 icon(1) Ralph Griswold uniq(1) Case Larsen
450 indent(1) David Willcox uucpd(8) Rick Adams
451 indent(1) Eric Schmidt uudecode(1) Mark Horton
452 indent(1) James Gosling uuencode(1) Mark Horton
453 indent(1) Sun Microsystems uuq(1) Lou Salkind
454 init(1) Donn Seeley uuq(1) Rick Adams
455 j0(3) Sun Microsystems, Inc. uusnap(8) Randy King
456 j1(3) Sun Microsystems, Inc. uusnap(8) Rick Adams
457 jn(3) Sun Microsystems, Inc. vacation(1) Eric Allman
458 join(1) David Goodenough vi(1) Steve Kirkendall
459 join(1) Michiro Hikida which(1) Peter Kessler
460 join(1) Steve Hayman who(1) Michael Fischbein
461 jot(1) John Kunze window(1) Edward Wang
462 jove(1) Jonathon Payne worm(6) Michael Toy
463 kermit(1) Columbia University worms(6) Eric P. Scott
464 kvm(3) Peter Shipley write(1) Craig Leres
465 kvm(3) Steven McCanne write(1) Jef Poskanzer
466 lam(1) John Kunze wump(6) Dave Taylor
467 larn(6) Noah Morgan X25/Ethernet Univ. of Erlangen-Nuremberg
468 lastcomm(1) Len Edmondson X25/LLC2 Dirk Husemann
469 lex(1) Vern Paxson xargs(1) John B. Roll Jr.
470 libm(3) Peter McIlroy xneko(6) Masayuki Koba
471 libm(3) UUNET Technologies, Inc. XNSrouted(1) Bill Nesheim
472 locate(1) James A. Woods xroach(6) J.T. Anderson
473 lock(1) Bob Toxen yacc(1) Robert Paul Corbett
476 .\" END OF CONTRIB: Contrib ends here.
487 \fB\s+4PREFACE\s-4\fP
492 The major new facilities available in the 4.4BSD release are
493 a new virtual memory system,
494 the addition of ISO/OSI networking support,
495 a new virtual filesystem interface supporting filesystem stacking,
496 a freely redistributable implementation of NFS,
497 a log-structured filesystem,
498 enhancement of the local filesystems to support
499 files and filesystems that are up to 2^63 bytes in size,
500 enhanced security and system management support,
501 and the conversion to and addition of the IEEE Std1003.1 (``POSIX'')
502 facilities and many of the IEEE Std1003.2 facilities.
503 In addition, many new utilities and additions have been made to the C-library.
504 The kernel sources have been reorganized to collect all machine-dependent
505 files for each architecture under one directory,
506 and most of the machine-independent code is now free of code
507 conditional on specific machines.
508 The user structure and process structure have been reorganized
509 to eliminate the statically-mapped user structure and to make most
510 of the process resources shareable by multiple processes.
511 The system and include files have been converted to be compatible
512 with ANSI C, including function prototypes for most of the exported
514 There are numerous other changes throughout the system.
516 Changes in the Kernel
518 This release includes several important structural kernel changes.
519 The kernel uses a new internal system call convention;
520 the use of global (``u-dot'') variables for parameters and error returns
522 and interrupted system calls no longer abort using non-local goto's (longjmp's).
523 A new sleep interface separates signal handling from scheduling priority,
524 returning characteristic errors to abort or restart the current system call.
525 This sleep call also passes a string describing the process state,
526 which is used by the ps(1) program.
527 The old sleep interface can be used only for non-interruptible sleeps.
529 Many data structures that were previously statically allocated
530 are now allocated dynamically.
531 These structures include mount entries, file entries,
532 user open file descriptors, the process entries, the vnode table,
533 the name cache, and the quota structures.
535 The 4.4BSD distribution adds support for several new architectures including
536 SPARC-based Sparcstations 1 and 2,
537 MIPS-based Decstation 3100 and 5000 and Sony NEWS,
538 68000-based Hewlett-Packard 9000/300 and Omron Luna, and
539 386-based Personal Computers.
540 Both the HP300 and SPARC ports feature the ability to run binaries
541 built for the native operating system (HP-UX or SunOS) by emulating
543 Though this native operating system compatibility was provided by the
544 developers as needed for their purposes and is by no means complete,
545 it is complete enough to run several non-trivial applications including
546 those that require HP-UX or SunOS shared libraries.
547 For example, the vendor supplied X11 server and windowing environment
548 can be used on both the HP300 and SPARC.
550 Virtual memory changes
552 The new virtual memory implementation is derived from the MACH
553 operating system developed at Carnegie-Mellon,
554 and was ported to the BSD kernel at the University of Utah.
555 The MACH virtual memory system call interface has been replaced with the
556 ``mmap''-based interface described in the ``Berkeley Software
557 Architecture Manual''.
558 The interface is similar to the interfaces shipped
559 by several commercial vendors such as Sun, USL, and Convex Computer Corp.
560 The integration of the new virtual memory is functionally complete,
561 but, like most MACH-based virtual memory systems,
562 still has serious performance problems under heavy memory load.
564 Networking additions and changes
566 The ISO/OSI Networking consists of a kernel implementation of
567 transport class 4 (TP-4),
568 connectionless networking protocol (CLNP),
569 and 802.3-based link-level support (hardware-compatible with Ethernet*).
571 *Ethernet is a trademark of the Xerox Corporation.
573 We also include support for ISO Connection-Oriented Network Service,
575 The session and presentation layers are provided outside
576 the kernel by the ISO development environment (ISODE).
577 Included in this development environment are file
578 transfer and management (FTAM), virtual terminals (VT),
579 a directory services implementation (X.500), and miscellaneous other utilities.
581 Several important enhancements have been added to the TCP/IP
582 protocols including TCP header prediction and
583 serial line IP (SLIP) with header compression.
584 The routing implementation has been completely rewritten
585 to use a hierarchical routing tree with a mask per route
586 to support the arbitrary levels of routing found in the ISO protocols.
587 The routing table also stores and caches route characteristics
588 to speed the adaptation of the throughput and congestion avoidance
591 Additions and changes to filesystems
593 The 4.4BSD distribution contains most of the interfaces
594 specified in the IEEE Std1003.1 system interface standard.
595 Filesystem additions include IEEE Std1003.1 FIFOs,
596 byte-range file locking, and saved user and group identifiers.
598 A new virtual filesystem interface has been added to the
599 kernel to support multiple filesystems.
600 In comparison with other interfaces,
601 the Berkeley interface has been structured for more efficient support
602 of filesystems that maintain state (such as the local filesystem).
603 The interface has been extended with support for stackable
604 filesystems done at UCLA.
605 These extensions allow for filesystems to be layered on top of each
606 other and allow new vnode operations to be added without requiring
607 changes to existing filesystem implementations.
608 For example, the umap filesystem
609 is used to mount a sub-tree of an existing filesystem
610 that uses a different set of uids and gids than the local system.
611 Such a filesystem could be mounted from a remote site via NFS or it
612 could be a filesystem on removable media brought from some foreign
613 location that uses a different password file.
615 In addition to the local ``fast filesystem'',
616 we have added an implementation of the network filesystem (NFS)
617 that fully interoperates with the NFS shipped by Sun and its licensees.
618 Because our NFS implementation was implemented using only the
619 publicly available NFS specification,
620 it does not require a license from Sun to use in source or binary form.
621 By default it runs over UDP to be compatible with Sun's implementation.
622 However, it can be configured on a per-mount basis to run over TCP.
623 Using TCP allows it to be used quickly and efficiently through
624 gateways and over long-haul networks.
625 Using an extended protocol, it supports Leases to allow a limited
626 callback mechanism that greatly reduces the network traffic necessary
627 to maintain cache consistency between the server and its clients.
629 A new log-structured filesystem has been added that provides
630 near disk-speed output and fast crash recovery.
631 It is still experimental in the 4.4BSD release,
632 so we do not recommend it for production use.
633 We have also added a memory-based filesystem that runs in
634 pageable memory, allowing large temporary filesystems without
635 requiring dedicated physical memory.
637 The local ``fast filesystem'' has been enhanced to do
638 clustering which allows large pieces of files to be
639 allocated contiguously resulting in near doubling
640 of filesystem throughput.
641 The filesystem interface has been extended to allow
642 files and filesystems to grow to 2^63 bytes in size.
643 The quota system has been rewritten to support both
644 user and group quotas (simultaneously if desired).
645 Quota expiration is based on time rather than
646 the previous metric of number of logins over quota.
647 This change makes quotas more useful on fileservers
648 onto which users seldom login.
650 The system security has been greatly enhanced by the
651 addition of additional file flags that permit a file to be
652 marked as immutable or append only.
653 Once set, these flags can only be cleared by the super-user
654 when the system is running single user.
655 To protect against indiscriminate reading or writing of kernel
656 memory, all writing and most reading of kernel data structures
657 must be done using a new ``sysctl'' interface.
658 The information to be access is described through an extensible
659 ``Management Information Base'' (MIB).
661 POSIX terminal driver changes
663 The biggest area of change is a new terminal driver.
664 The terminal driver is similar to the System V terminal driver
665 with the addition of the necessary extensions to get the
666 functionality previously available in the 4.3BSD terminal driver.
667 4.4BSD also adds the IEEE Std1003.1 job control interface,
668 which is similar to the 4.3BSD job control interface,
669 but adds a security model that was missing in the
670 4.3BSD job control implementation.
671 A new system call, \fIsetsid\fP,
672 creates a job-control session consisting of a single process
673 group with one member, the caller, that becomes a session leader.
674 Only a session leader may acquire a controlling terminal.
675 This is done explicitly via a \s-1TIOCSCTTY\s+1 \fIioctl\fP call,
676 not implicitly by an \fIopen\fP call.
677 The call fails if the terminal is in use.
679 For backward compatibility,
680 both the old \fIioctl\fP
681 calls and old options to \fIstty\fP
684 Changes to the utilities
686 There are several new tools and utilities included in this release.
687 A new version of ``make'' allows much-simplified makefiles for the
688 system software and allows compilation for multiple architectures
689 from the same source tree (which may be mounted read-only).
690 Notable additions to the libraries include functions to traverse a
691 filesystem hierarchy, database interfaces to btree and hashing functions,
692 a new, fast implementation of stdio and a radix sort function.
693 The additions to the utility suite include greatly enhanced versions of
694 programs that display system status information, implementations of
695 various traditional tools described in the IEEE Std1003.2 standard,
698 We have been tracking the IEEE Std1003.2 shell and utility work
699 and have included prototypes of many of the proposed utilities.
700 Most of the traditional utilities have been replaced
701 with implementations conformant to the POSIX standards.
702 Almost the entire manual suite has been rewritten to
703 reflect the POSIX defined interfaces.
704 In rewriting this software, we have generally
705 been rewarded with significant performance improvements.
706 Most of the libraries and header files have been converted
707 to be compliant with ANSI C.
708 The system libraries and utilities all compile
709 with either ANSI or traditional C.
711 The Kerberos (version 4) authentication software has been
712 integrated into much of the system (including NFS) to provide
713 the first real network authentication on BSD.
715 A new implementation of the \fIex/vi\fP text editors is available
717 It is intended as a bug-for-bug compatible version of the editors.
718 It also has a few new features: 8-bit clean data, lines and files
719 limited only by memory and disk space, split screens, tags stacks
720 and left-right scrolling among them.
722 is not yet production quality; future versions of this software may
723 be retrieved by anonymous ftp from ftp.cs.berkeley.edu, in the
727 utility has two new options that are important to be aware of if you
729 The ``fstype'' and ``prune'' options can be used together to prevent
730 find from crossing NFS mount points.
732 Additions and changes to the libraries
735 library has been largely rewritten.
736 Important additional features include support
737 for scrolling and \fItermios\fP.
739 An application front-end editing library, named libedit, has been
742 A superset implementation of the SunOS kernel memory interface library,
743 \fIlibkvm\fP, has been integrated into the system.
745 Nearly the entire C-library has been rewritten.
746 Some highlights of the changes to the 4.4BSD C-library:
748 The newly added \fIfts\fP
749 functions will do either physical or logical traversal of
750 a file hierarchy as well as handle essentially infinite depth
751 filesystems and filesystems with cycles.
752 All the utilities in 4.4BSD that traverse file hierarchies
753 have been converted to use \fIfts\fP.
754 The conversion has always resulted in a significant performance
755 gain, often of four or five to one in system time.
757 The newly added \fIdbopen\fP
758 functions are intended to be a family of database access methods.
759 Currently, they consist of \fIhash\fP,
760 an extensible, dynamic hashing scheme,
761 \fIbtree\fP, a sorted, balanced tree structure (B+tree's), and
762 \fIrecno\fP, a flat-file interface for fixed or variable length records
763 referenced by logical record number.
764 Each of the access methods stores associated key/data pairs and
765 uses the same record oriented interface for access.
766 Future versions of this software may be retrieved by anonymous ftp
767 from ftp.cs.berkeley.edu, in the directory ucb/4bsd.
770 function has been rewritten for additional performance.
771 In addition, three new types of sorting functions,
772 \fIheapsort\fP, \fImergesort\fP, and \fIradixsort\fP
773 have been added to the system.
775 function is optimized for data with pre-existing order,
776 in which case it usually significantly outperforms \fIqsort\fP.
778 functions are variants of most-significant-byte radix sorting.
779 They take time linear to the number of bytes to be
780 sorted, usually significantly outperforming \fIqsort\fP
781 on data that can be sorted in this fashion.
782 An implementation of the POSIX 1003.2 standard \fIsort\fP
783 based on \fIradixsort\fP is included in 4.4BSD.
785 The floating point support in the C-library has been replaced
788 The C functions specified by both ANSI C, POSIX 1003.1 and
789 1003.2 are now part of the C-library.
790 This includes support for file name matching, shell globbing
791 and both basic and extended regular expressions.
793 ANSI C multibyte and wide character support has been integrated.
794 The rune functionality from the Bell Labs' Plan 9 system is provided
798 functions have been generalized and replaced with a general
799 purpose interface named \fIgetcap\fP.
802 routines have been replaced, and are usually much faster.
803 In addition, the \fIfunopen\fP
804 interface permits applications to provide their own I/O stream
809 We were greatly assisted by the past employees of the Computer Systems
810 Research Group: Mike Karels, Keith Sklower, and Marc Tietelbaum.
811 Our distribution coordinator, Pauline Schwartz, has reliably managed
812 the finances and the mechanics of shipping distributions for
813 nearly the entire fourteen years of the group's existence.
814 Without the help of lawyers Mary MacDonald, Joel Linzner,
815 and Carla Shapiro, the 4.4BSD-Lite distribution would never
816 have seen the light of day.
817 Much help was provided by Chris Demetriou in getting bug fixes
818 from NetBSD integrated back into the 4.4BSD-Lite distribution.
820 The vast majority of the 4.4BSD distribution comes from the numerous
821 people in the UNIX community that provided their time and energy in
822 creating the software contained in this release.
823 We dedicate this distribution to them.
837 \fIPreface to the 4.3 Berkeley distribution\fP
840 This update to the 4.2 distribution of August 1983 provides
841 substantially improved performance, reliability, and security,
842 the addition of Xerox Network System (NS) to the set of networking domains,
843 and partial support for the VAX 8600 and MICROVAXII.
845 We were greatly assisted by the DEC UNIX Engineering group who
846 provided two full time employees, Miriam Amos and Kevin Dunlap,
847 to work at Berkeley. They were responsible for developing and
848 debugging the distributed domain based name server
849 and integrating it into the mail system.
850 Mt Xinu provided the bug list distribution service as well as
851 donating their MICROVAXII port to 4.3BSD.
852 Drivers for the MICROVAXII were done by Rick Macklem
853 at the University of Guelph.
854 Sam Leffler provided valuable assistance and advice with many projects.
855 Keith Sklower coordinated with William Nesheim and J. Q. Johnson at Cornell,
856 and Chris Torek and James O'Toole at the University of Maryland
857 to do the Xerox Network Systems implementation.
858 Robert Elz at the University of Melbourne contributed greatly
859 to the performance work in the kernel.
860 Donn Seeley and Jay Lepreau at the University of Utah
861 relentlessly dealt with a myriad of details;
862 Donn completed the unfinished performance work on Fortran 77
863 and fixed numerous C compiler bugs.
864 Ralph Campbell handled innumerable questions and problem reports
865 and had time left to write rdist.
866 George Goble was invaluable in shaking out the bugs on his
867 production systems long before we were confident enough to
868 inflict it on our users.
869 Bill Shannon at Sun Microsystems has been helpful in
870 providing us with bug fixes and improvements.
871 Tom Ferrin, in his capacity as Board Member of Usenix Association,
872 handled the logistics of large-scale reproduction
873 of the 4.2BSD and 4.3BSD manuals.
874 Mark Seiden helped with the typesetting and indexing of the 4.3BSD manuals.
875 Special mention goes to Bob Henry for keeping ucbvax running
876 in spite of new and improved software and
877 an ever increasing mail, news, and uucp load.
879 Numerous others contributed their time and energy in creating
880 the user contributed software for the release.
881 As always, we are grateful to the UNIX user community for
882 encouragement and support.
884 Once again, the financial support of the Defense Advanced Research
885 Projects Agency is gratefully acknowledged.
897 \fIPreface to the 4.2 Berkeley distribution\fP
899 This update to the 4.1 distribution of June 1981 provides support
900 for the VAX 11/730, full networking and interprocess communication
901 support, an entirely new file system, and many other new features.
902 It is certainly the most ambitious release of software ever prepared
903 here and represents many man-years of work.
904 Bill Shannon (both at DEC and at Sun Microsystems)
905 and Robert Elz of the University
906 of Melbourne contributed greatly to this distribution
907 through new device drivers and painful debugging episodes.
908 Rob Gurwitz of BBN wrote the initial version of the code upon
909 which the current networking support is based.
910 Eric Allman of Britton-Lee donated countless hours to the mail system.
911 Bill Croft (both at SRI and Sun Microsystems) aided in the
912 debugging and development of the networking facilities.
913 Dennis Ritchie of Bell Laboratories also
914 contributed greatly to this distribution, providing
915 valuable advise and guidance. Helge Skrivervik
916 worked on the device drivers which enabled
917 the distribution to be delivered with a TU58
918 console cassette and RX01 console flopppy disk, and
919 rewrote major portions of the standalone i/o system
920 to support formatting of non-DEC peripherals.
922 Numerous others contributed their time and energy in organizing
923 the user software for release, while many groups of people on
924 campus suffered patiently through the low spots of development.
925 As always, we are grateful to the UNIX user community for
926 encouragement and support.
928 Once again, the financial support of the Defense Advanced Research
929 Projects Agency is gratefully acknowledged.
941 \fIPreface to the 4.1 Berkeley distribution\fP
943 This update to the fourth distribution of November 1980 provides
944 support for the VAX 11/750 and for the full interconnect architecture
945 of the VAX 11/780. Robert Elz of the University of Melbourne contributed
946 greatly to this distribution especially in the boot-time system
947 configuration code; Bill Shannon of DEC supplied us with the
948 implementation of DEC standard bad block handling. The research
949 group at Bell Laboratories and DEC Merrimack provided us with access
950 to 11/750's in order to debug its support.
952 Other individuals too numerous to mention provided us with bug reports,
953 fixes and other enhancements which are reflected in the system. We
954 are grateful to the UNIX user community for encouragement and
957 The financial support of the Defence Advanced Research Projects Agency
958 in support of this work is gratefully acknowledged.
970 \fIPreface to the Fourth Berkeley distribution\fP
972 This manual reflects the Berkeley system mid-October, 1980.
973 A large amount of tuning has been done in the system since the last release;
974 we hope this provides as noticeable an improvement for you as it did for us.
975 This release finds the system in transition; a number of facilities
976 have been added in experimental versions (job control, resource limits)
977 and the implementation of others is imminent (shared-segments, higher
978 performance from the file system, etc.).
979 Applications which use facilities that are in transition should be aware
980 that some of the system calls and library routines will change
981 in the near future. We have tried to be conscientious and make it
982 very clear where this is likely.
984 A new group has been formed
985 at Berkeley, to assume responsibility for the future
986 development and support of a version of UNIX on the VAX.
987 The group has received funding from the
988 Defense Advanced Research Projects Agency (DARPA)
989 to supply a standard version of the system to DARPA contractors.
990 The same version of the system will be made available to other licensees
991 of UNIX on the VAX for a duplication charge.
992 We gratefully acknowledge
993 the support of this contract.
995 We wish to acknowledge the contribution of a number of individuals to
998 We would especially like to thank
1000 Laxenburg Austria and his colleagues,
1001 who first put job control facilities into UNIX;
1002 Eric Allman, Robert Henry, Peter Kessler and Kirk McKusick, who
1003 contributed major new pieces of software;
1004 Mark Horton, who contributed to the improvement of facilities and
1005 substantially improved the quality of our bit-mapped fonts,
1006 our hardware support staff:
1012 who helped us to debug a number of new peripherals;
1013 Ken Arnold who did much of the leg-work in getting this version of the
1014 manual prepared, and did the final editing of sections 2-6,
1015 some special individuals within Bell Laboratories:
1027 who helped out by answering questions;
1028 our excellent local DEC field service people,
1029 Kevin Althaus and Frank Chargois
1030 who kept our machine running virtually all the time, and fixed it quickly
1033 Mike Accetta of Carnegie-Mellon University,
1034 Robert Elz of the University of Melbourne,
1035 George Goble of Purdue University,
1037 David Kashtan of the Stanford Research Institute
1038 for their technical advice and support.
1040 Special thanks to Bill Munson of DEC who helped by augmenting
1041 our computing facility
1042 and to Eric Allman for carefully proofreading the
1043 ``last'' draft of the manual and finding the bugs which we knew were
1044 there but couldn't see.
1046 We dedicate this to the memory of David Sakrison, late chairman of our
1047 department, who gave his support to the establishment of our VAX
1048 computing facility, and to our department as a whole.
1053 \v'-3p'\h'2p'\*:\v'3p'\h'-2p'O. Babao\*~glu
1061 \fIPreface to the Third Berkeley distribution\fP
1063 This manual reflects the state of the Berkeley system, December 1979.
1064 We would like to thank all the people at Berkeley who have contributed to
1065 the system, and particularly thank
1066 Prof. Richard Fateman for creating and administrating a hospitable environment,
1067 Mark Horton who helped prepare this manual, and
1068 Eric Allman, Bob Kridle, Juan Porcar
1069 and Richard Tuck for their contributions to the kernel.
1071 The cooperation of Bell Laboratories in providing us with an early version of
1072 \s-2UNIX\s0/32V is greatly appreciated. We would especially like to thank
1073 Dr. Charles Roberts of Bell Laboratories for helping us obtain this release,
1081 for their advice and support.
1086 \v'-3p'\h'2p'\*:\v'3p'\h'-2p'O. Babao\*~glu
1091 \fIPreface to the UNIX/32V distribution\fP
1095 operating system for the VAX*-11
1097 *VAX and PDP are Trademarks of Digital Equipment Corporation.
1099 provides substantially the same facilities as the
1101 system for the PDP*-11.
1103 We acknowledge the work of many who came before us, and particularly thank
1104 G. K. Swanson, W. M. Cardoza, D. K. Sharma, and J. F. Jarvis for assistance
1105 with the implementation for the VAX-11/780.
1115 \fIPreface to the Seventh Edition\fP
1118 Although this Seventh Edition no longer bears their byline,
1119 Ken Thompson and Dennis Ritchie remain the fathers
1120 and preceptors of the
1122 time-sharing system.
1123 Many of the improvements here described bear their mark.
1124 Among many, many other people who have contributed to
1125 the further flowering of
1127 we wish especially to
1128 acknowledge the contributions of
1147 the effective advice and criticism of
1153 and we remember the important work of
1154 the late Joseph F. Ossanna.
1168 \fR\\$1\fI\\$2\^\fR\\$3
1171 \fB\s+4INTRODUCTION\s-4\fP
1176 The documentation for 4.4BSD is in a format similar
1177 to the one used for the 4.2BSD and 4.3BSD manuals.
1178 It is divided into three sets; each set consists of one or more volumes.
1179 The abbreviations for the volume names are listed in square brackets;
1180 the abbreviations for the manual sections are listed in parenthesis.
1183 User's Reference Manual [URM]
1186 Macro packages and language conventions (7)
1187 User's Supplementary Documents [USD]
1190 Communicating with the World
1192 Document Preparation
1195 II. Programmer's Documents
1196 Programmer's Reference Manual [PRM]
1200 File formats and conventions (5)
1201 Programmer's Supplementary Documents [PSD]
1202 Documents of Historic Interest
1203 Languages in common use
1205 Programming Libraries
1208 III. System Manager's Manual [SMM]
1209 Maintenance commands (8)
1210 System Installation and Administration
1213 References to individual documents are given as ``volume:document'',
1214 thus USD:1 refers to the first document in the ``User's Supplementary
1216 References to manual pages are given as ``\fIname\fP(section)'' thus
1218 refers to the shell manual entry in section 1.
1220 The manual pages give descriptions of the features of the
1221 4.4BSD system, as developed at the University of California at Berkeley.
1222 They do not attempt to provide perspective or tutorial information about the
1223 4.4BSD operating system, its facilities, or its implementation.
1224 Various documents on those topics are contained in the
1225 ``\s-1UNIX\s+1 User's Supplementary Documents'' (USD), the
1226 ``\s-1UNIX\s+1 Programmer's Supplementary Documents'' (PSD),
1227 and ``\s-1UNIX\s+1 System Manager's Manual'' (SMM).
1228 In particular, for an overview see ``The \s-1UNIX\s+1 Time-Sharing System'' (PSD:1)
1229 by Ritchie and Thompson; for a tutorial see
1230 ``\s8\s-1UNIX\s+1\s10 for Beginners'' (USD:1) by Kernighan,
1231 and for an guide to the new features of this latest version, see
1232 ``Berkeley Software Architecture Manual (4.4 Edition)'' (PSD:5).
1234 Within the area it surveys, this volume attempts to be timely, complete
1235 and concise. Where the latter two objectives conflict,
1236 the obvious is often left unsaid in favor of brevity.
1237 It is intended that each program be described as it is, not as it should be.
1238 Inevitably, this means that various sections will soon be out of date.
1240 Commands are programs intended to be invoked directly by
1241 the user, in contrast to subroutines, that are
1242 intended to be called by the user's programs.
1243 User commands are described in URM section 1.
1244 Commands generally reside in directory
1249 Some programs also reside in
1256 These directories are searched automatically by the command interpreters.
1257 Additional directories that may be of interest include
1259 /\|usr/\|contrib/\|bin,
1261 which has contributed software
1265 which has old but sometimes still useful software and
1267 /\|usr/\|local/\|bin,
1269 which contains software local to your site.
1271 Games have been relegated to URM section 6 and
1275 to keep them from contaminating
1276 the more staid information of URM section 1.
1278 Miscellaneous collection of information necessary for
1279 writing in various specialized languages such as character codes,
1280 macro packages for typesetting, etc is contained in URM section 7.
1282 System calls are entries into the BSD kernel.
1283 The system call interface is identical to a C language
1284 procedure call; the equivalent C procedures are described in PRM section 2.
1286 An assortment of subroutines is available;
1287 they are described in PRM section 3.
1288 The primary libraries in which they are kept are described in
1290 The functions are described in terms of C.
1292 PRM section 4 discusses the characteristics of
1293 each system ``file'' that refers to an I/O device.
1294 The names in this section refer to the HP300 device names for the hardware,
1295 instead of the names of the special files themselves.
1297 The file formats and conventions (PRM section 5)
1298 documents the structure of particular kinds of files;
1299 for example, the form of the output of the loader and
1300 assembler is given. Excluded are files used by only one command,
1301 for example the assembler's intermediate files.
1303 Commands and procedures intended for use primarily by the
1304 system administrator are described in SMM section 8.
1305 The files described here are almost all kept in the directory
1307 The system administration binaries reside in
1315 Each section consists of independent entries of a page or so each.
1316 The name of the entry is in the upper corners of its pages,
1317 together with the section number.
1318 Entries within each section are alphabetized.
1319 The page numbers of each entry start at 1;
1320 it is infeasible to number consecutively the pages of
1321 a document like this that is republished in many variant forms.
1323 All entries are based on a common format;
1324 not all subsections always appear.
1329 subsection lists the exact names of the commands and subroutines
1330 covered under the entry and gives a short description of their purpose.
1334 summarizes the use of the program being described.
1335 A few conventions are used, particularly in the Commands subsection:
1339 words are considered literals, and are typed just as they appear.
1341 Square brackets [ ] around an argument show that the argument is optional.
1342 When an argument is given as ``name'', it always refers to a file name.
1344 Ellipses ``.\|.\|.'' are used to show that the previous argument-prototype
1347 A final convention is used by the commands themselves.
1348 An argument beginning with a minus sign ``\-'' usually means that it is an
1349 option-specifying argument, even if it appears in a position where
1350 a file name could appear. Therefore, it is unwise to have files whose
1351 names begin with ``\-''.
1356 subsection discusses in detail the subject at hand.
1360 subsection gives the names of files that are built into the program.
1366 subsection gives pointers to related information.
1370 subsection discusses the diagnostic indications that may be produced.
1371 Messages that are intended to be self-explanatory are not listed.
1375 subsection gives known bugs and sometimes deficiencies.
1376 Occasionally the suggested fix is also described.
1379 At the beginning of URM is a table of contents,
1380 organized by section and alphabetically within each section.
1381 There is also a permuted index derived from the table of contents.
1382 Within each index entry, the title of the writeup to which
1383 it refers is followed by the appropriate section number in parentheses.
1384 This fact is important because there is considerable
1385 name duplication among the sections, arising principally from commands that
1386 exist only to exercise a particular system call.
1387 Finally, there is a list of documents on the inside back cover of each volume.
1391 This section sketches the basic information you need to get started on \s-1UNIX\s+1;
1392 how to log in and log out, how to communicate through your terminal,
1393 and how to run a program.
1394 See ``\s-1UNIX\s+1 for Beginners'' in (USD:1) for a
1395 more complete introduction to the system.
1400 Almost any ASCII terminal capable of
1401 full duplex operation and generating
1402 the entire character set can be used.
1403 You must have a valid user name,
1404 which may be obtained from the system administration.
1405 If you will be accessing \s-1UNIX\s+1 remotely, you will also
1406 need to obtain the telephone number for the system that you will be using.
1408 After a data connection is established,
1409 the login procedure depends on what type of terminal you are using
1410 and local system conventions.
1411 If your terminal is directly connected to the computer,
1412 it generally runs at 9600 or 19200 baud.
1413 If you are using a modem running over a phone line,
1414 the terminal must be set at the speed appropriate for the modem you are using,
1415 typically 1200, 2400, or 9600 baud.
1416 The half/full duplex switch should always be set at full-duplex.
1417 (This switch will often have to be changed
1418 since many other systems require half-duplex).
1420 When a connection is established, the system types ``login:'';
1421 you type your user name, followed by the ``return'' key.
1422 If you have a password, the system asks for it
1423 and suppresses echo to the terminal so the password will not appear.
1424 After you have logged in, the ``return'', ``new line'', or ``linefeed'' keys
1425 will give exactly the same results.
1426 A message-of-the-day usually greets you before your first prompt.
1428 If the system types out a few garbage characters
1429 after you have established a data connection
1430 (the ``login:'' message at the wrong speed),
1431 depress the ``break'' (or ``interrupt'') key.
1432 This is a speed-independent signal to \s-1UNIX\s+1
1433 that a different speed terminal is in use.
1434 The system then will type ``login:,'' this time at another speed.
1435 Continue depressing the break key until ``login:'' appears clearly,
1436 then respond with your user name.
1438 For all these terminals, it is important
1439 that you type your name in lower-case if possible; if you type
1441 \s-1UNIX\s+1 will assume that your terminal cannot generate lower-case
1442 letters and will translate all subsequent lower-case letters to upper case.
1444 The evidence that you have successfully logged in is that a shell program
1445 will type a prompt (``$'' or ``%'') to you.
1446 (The shells are described below under ``How to run a program.'')
1448 For more information, consult
1452 which tell how to adjust terminal behavior;
1454 discusses the login sequence in more detail, and
1456 discusses terminal I/O.
1461 There are three ways to log out:
1463 By typing ``logout'' or an end-of-file
1464 indication (EOT character, control-D) to the shell.
1465 The shell will terminate and the ``login:'' message will appear again.
1467 You can log in directly as another user by giving a
1471 If worse comes to worse,
1472 you can simply hang up the phone; but beware \- some machines may
1473 lack the necessary hardware to detect that the phone has been hung up.
1474 Ask your system administrator if this is a problem on your machine.
1477 How to communicate through your terminal.\ \
1479 When you type characters, a gnome deep in the system
1480 gathers your characters and saves them in a secret place.
1481 The characters will not be given to a program
1482 until you type a return (or newline), as described above in
1487 \s-1UNIX\s+1 terminal I/O is full-duplex.
1488 It has full read-ahead, which means that you can type at any time,
1489 even while a program is typing at you.
1490 Of course, if you type during output, the printed output will
1491 have the input characters interspersed.
1492 However, whatever you type will be saved up and interpreted in correct sequence.
1493 There is a limit to the amount of read-ahead,
1494 but it is generous and not likely to be exceeded unless
1495 the system is in trouble.
1496 When the read-ahead limit is exceeded, the system
1497 throws away all the saved characters (or beeps, if your prompt was a ``%'').
1499 The ^U (control-U) character in typed input kills all the
1500 preceding characters in the line,
1501 so typing mistakes can be repaired on a single line.
1502 Also, the delete character (DEL) or sometimes the
1503 backspace character (control-H) erases the last character typed.
1507 can be used to change these defaults.
1508 Successive uses of delete (or backspace) erases characters back to, but
1509 not beyond, the beginning of the line.
1510 DEL and ^U (control-U) can be transmitted to a program by preceding them with
1512 (So, to erase ^V (control-V), you need two deletes or backspaces).
1518 is sent to a program by typing ^C (control-C) or the ``break'' key
1519 which is not passed to programs.
1520 This signal generally causes whatever program you are running to terminate.
1521 It is typically used to stop a long printout that you do not want.
1522 However, programs can arrange either to ignore this signal altogether,
1523 or to be notified when it happens (instead of being terminated).
1524 The editor, for example, catches interrupts and stops what it is doing,
1525 instead of terminating, so that an interrupt can
1526 be used to halt an editor printout without losing the file being edited.
1527 The interrupt character can also be changed with
1532 It is also possible to suspend output temporarily using ^S (control-S)
1533 and later resume output with ^Q (control-Q).
1534 Output can be thrown away without interrupting
1535 the program by typing ^O (control-O); see
1540 signal is generated by typing the \s8ASCII\s10 FS character.
1541 (FS appears many places on different terminals, most commonly
1542 as control-\e or control-\^|\^.)
1543 It not only causes a running program to terminate
1544 but also generates a file with the core image of the terminated process.
1545 Quit is useful for debugging.
1547 Besides adapting to the speed of the terminal,
1548 \s-1UNIX\s+1 tries to be intelligent about whether
1549 you have a terminal with the newline function
1550 or whether it must be simulated with carriage-return and line-feed.
1551 In the latter case, all input carriage returns
1552 are turned to newline characters (the standard line delimiter)
1553 and both a carriage return and a line feed are echoed to the terminal.
1554 If you get into the wrong mode, the
1556 command will rescue you.
1557 If the terminal does not appear to be echoing anything that you type,
1558 it may be stuck in ``no-echo'' or ``raw'' mode.
1559 Try typing ``(control-J)reset(control-J)'' to recover.
1561 Tab characters are used freely in \s-1UNIX\s+1 source programs.
1562 If your terminal does not have the tab function,
1563 you can arrange to have them turned into spaces
1564 during output, and echoed as spaces during input.
1565 The system assumes that tabs are set every eight columns.
1570 command can be used to change these defaults.
1572 can be used to set the tab stops automatically when necessary.
1575 How to run a program; the shells.\ \
1577 When you have successfully logged in, a program
1578 called a shell is listening to your terminal.
1579 The shell reads typed-in lines, splits them up
1580 into a command name and arguments, and executes the command.
1581 A command is simply an executable program.
1582 The shell looks in several system directories to find the command.
1583 You can also place commands in your own directory and
1584 have the shell find them there.
1585 There is nothing special about system-provided
1586 commands except that they are kept in a directory where the shell can find them.
1588 The command name is always the first word on an input line;
1589 it and its arguments are separated from one another by spaces.
1591 When a program terminates, the shell will ordinarily regain control and type
1592 a prompt at you to show that it is ready for another command.
1594 The shells have many other capabilities, that are described in detail in
1599 If the shell prompts you with ``$'', then it is an instance of
1601 the original \s-1UNIX\s+1 shell.
1602 If it prompts with ``%'' then it is an instance of
1604 a shell written at Berkeley.
1605 The shells are different for all but the most simple terminal usage.
1606 Most users at Berkeley choose
1612 feature, that greatly enhance its power when used interactively.
1614 also supports the job-control facilities;
1617 or the Csh introduction in USD:4 for details.
1619 You can change from one shell to the other by using the
1621 command, which takes effect at your next login.
1624 The current directory.\ \
1626 \s-1UNIX\s+1 has a file system arranged as a hierarchy of directories.
1627 When the system administrator gave you a user name,
1628 they also created a directory for you (ordinarily
1629 with the same name as your user name).
1630 When you log in, any file name you type is by default in this directory.
1631 Since you are the owner of this directory, you have
1632 full permission to read, write, alter, or destroy its contents.
1633 Permissions to have your will with other directories
1634 and files will have been granted or denied to you by their owners.
1635 As a matter of observed fact, few \s-1UNIX\s+1
1636 users protect their files from perusal by other users.
1638 To change the current directory (but not the set of permissions you
1639 were endowed with at login) use
1645 To refer to files not in the current directory, you must use a path name.
1646 Full path names begin with ``/\|'', the name of the root directory of the
1648 After the slash comes the name of each directory containing the next
1649 sub-directory (followed by a ``/\|'') until finally the file name is reached.
1652 /\^var/\^tmp/\^filex
1662 is itself a subdirectory of
1666 springs directly from the root directory.
1668 If your current directory has subdirectories,
1669 the path names of files therein begin with
1670 the name of the subdirectory with no prefixed ``/\|''.
1672 A path name may be used anywhere a file name is required.
1674 Important commands that modify the contents of files are
1679 which respectively copy, move (i.e. rename) and remove files.
1680 To find out the status of files or directories, use
1684 for making directories and
1686 for destroying them.
1688 For a fuller discussion of the file system, see
1689 ``A Fast File System for \s-1UNIX\s+1'' (SMM:5)
1690 by McKusick, Joy, Leffler, and Fabry.
1691 It may also be useful to glance through PRM section 2,
1692 that discusses system calls, even if you do not intend
1693 to deal with the system at that level.
1696 Writing a program.\ \
1698 To enter the text of a source program into a \s-1UNIX\s+1 file,
1699 use the standard display editor
1701 or its \s-1WYSIWYG\s+1 counterparts
1705 (The old standard editor
1708 The principle language in \s-1UNIX\s+1 is provided by the C compiler
1710 User contributed software in the latest
1711 release of the system supports the programming languages perl and C++.
1712 After the program text has been entered through the editor
1713 and written to a file, you can give the file
1714 to the appropriate language processor as an argument.
1715 The output of the language processor
1716 will be left on a file in the current directory named ``a.out''.
1717 If the output is precious, use
1719 to move it to a less exposed name after successful compilation.
1721 When you have finally gone through this entire process
1722 without provoking any diagnostics, the resulting program
1723 can be run by giving its name to the shell
1724 in response to the shell (``$'' or ``%'') prompt.
1726 Your programs can receive arguments from the command line
1727 just as system programs do,
1728 see ``\s-1UNIX\s+1 Programming - Second Edition'' (PSD:4),
1729 or for a more terse description
1735 Almost all text is entered through an editor such as
1740 The commands most often used to write text on a terminal are:
1748 command simply dumps \s8ASCII\s10 text
1749 on the terminal, with no processing at all.
1751 is useful for preventing the output of a command from
1752 scrolling off the top of your screen.
1753 It is also well suited to perusing files.
1755 is an elaborate text formatting program.
1756 Used naked, it requires careful forethought, but for
1757 ordinary documents it has been tamed; see
1763 converts documents to postscript for output to a
1764 Laserwriter or Phototypesetter.
1767 and often works from exactly the same source text.
1768 It was used to produce this manual.
1771 lets you keep a record of your session in a file,
1772 which can then be printed, mailed, etc.
1773 It provides the advantages of a hard-copy terminal
1774 even when using a display terminal.
1777 Status inquiries.\ \
1779 Various commands exist to provide you with useful information.
1781 prints a list of users currently logged in, and what they are doing.
1783 prints the current time and date.
1785 will list the files in your directory or give
1786 summary information about particular files.
1791 Certain commands provide inter-user communication.
1792 Even if you do not plan to use them, it would be
1793 well to learn something about them, because someone else may aim them at you.
1795 To communicate with another user currently logged in,
1801 will leave a message whose presence will be announced
1802 to another user when they next log in.
1803 The write-ups in the manual also suggest how to respond to
1804 the these commands if you are a target.
1808 the key ^Z (control-Z) will cause jobs to ``stop''.
1809 If this happens before you learn about it,
1810 you can simply continue by saying ``fg'' (for foreground) to bring
1813 We hope that you will come to enjoy using the BSD system.
1814 Although it is very large and contains many commands,
1815 you can become very productive using only a small subset of them.
1816 As your needs expand to doing new tasks,
1817 you will almost always find that the system has the facilities
1818 that you need to accomplish them easily and quickly.
1820 Most importantly, the source code to the BSD system
1821 is cheaply available to anyone that wants it.
1822 On many BSD systems, it can be found in the directory
1824 You may simply want to find out how something works
1825 or fix some important bug without waiting months for
1826 your vendor to respond.
1827 It is also particularly useful if you
1828 want to grab another piece of code to bootstrap a new project.
1829 Provided that you retain the copyrights and acknowledgements
1830 at the top of each file, you are free to redistribute your
1831 work for fun or profit.
1832 Naturally, we hope that you will allow others to also redistribute
1833 your code, though you are not required to do so unless you
1834 use copyleft code (which is primarily found in the software
1835 contributed from the Free Software Foundation and is
1836 clearly identified).
1838 Good luck and enjoy BSD.
1839 .OH '''\s10- % -\s0'
1840 .EH '\s10- % -\s0'''
1844 .EF '\s9\\\\*(Dt''\\\\*(Ed\s0'
1845 .OF '\s9\\\\*(Ed''\\\\*(Dt\s0'
1847 \s+4\fBLIST \|OF \|MANUAL \|PAGES\fP\s-4
1861 \f3\s9\\$2. \\$3\s0\fP
1869 .t toc1 1 "Commands and Application Programs"
1870 .t toc2 2 "System Calls"
1871 .t toc3 3 "C Library Subroutines"
1872 .t toc4 4 "Special Files"
1873 .t toc5 5 "File Formats"
1875 .t toc7 7 "Miscellaneous"
1876 .t toc8 8 "System Maintenance"
1879 .ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
1884 .OH '\s9\fIPermuted Index\fP''- % -\s0'
1885 .EH '\s9- % -''\fIPermuted Index\fP\s0'
1889 \s+4\fBPERMUTED \|INDEX\fP\s-4
1894 .\" backup from slotput 1, slot, 2
1900 .if \w
\ 2\\$2
\ 2 .ds s1 ~~\"
1903 .if \w
\ 2\\$4
\ 2 .ds s3 ~~\"
1906 .ds y \\*(s4\f3
\ 1\fP\\*(s5
1907 .ta 6i-\w
\ 2\\*(s5
\ 2u
1908 \h"3i-\w
\ 2\\$1\\*(s1\\$2\\*(s2
\ 2u"\\$1\\*(s1\\$2\\*(s2\\$3\\*(s3\\$4\\*y\\$5
1912 .ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i