|
|
1.1 ! root 1: .SP .5i ! 2: .TL ! 3: INTRODUCTION ! 4: .SP 2 ! 5: .LP ! 6: This volume describes facilities of the version of the ! 7: .SM UNIX ! 8: operating system that is used ! 9: at the system's original home, the ! 10: computing science research center of AT&T Bell Laboratories. ! 11: Volume 2 discusses certain aspects of the system in more detail. ! 12: For tutorial information, consult a standard reference such as ! 13: .I "The Unix Programming Environment ! 14: by Kernighan and Pike. ! 15: .LP ! 16: Within the area it surveys, this volume attempts ! 17: to be timely, complete and concise. ! 18: Where the latter two objectives conflict, ! 19: the obvious is often left unsaid in favor of brevity. ! 20: It is intended that each program be described ! 21: as it is, not as it should be. ! 22: Inevitably, as snapshots of a living system, some of ! 23: the descriptions may soon go out of date. ! 24: When that happens, users may find the latest word in ! 25: an on-line form of this book. ! 26: .LP ! 27: The volume is divided into sections; ! 28: each section consists of a number of independent pages. ! 29: (Some `pages' spill over beyond one sheet of paper.) ! 30: The name of a page is in its upper corners ! 31: together with the section number. ! 32: Sections 3 and 9 have further substructure as described in ! 33: their respective introductions. ! 34: Pages are arranged alphabetically within sections. ! 35: Here and in much other documentation, ! 36: the notation ! 37: .I man (1) ! 38: refers to the page for the ! 39: .I man ! 40: command in section 1. ! 41: (This particular command prints selections from the on-line manual.) ! 42: .LP ! 43: There are nine printed sections and one unprinted appendix. ! 44: .DS ! 45: 1. Commands ! 46: 2. System calls ! 47: 3. Subroutines ! 48: 4. Devices, line disciplines, and file systems ! 49: 5. File formats and conventions ! 50: 6. Language conventions ! 51: 7. Information sources ! 52: 8. Maintenance commands and procedures ! 53: 9. Teletype 5620-related software ! 54: A. Other facilities ! 55: .DE ! 56: Section 1 describes ! 57: programs intended to be invoked directly by ! 58: the user, in contradistinction to subroutines, which are ! 59: intended to be called by the user's programs. ! 60: Essential commands generally reside in directory ! 61: .CW /bin ! 62: (for ! 63: .I bin \|ary ! 64: programs) or ! 65: .CW /usr/bin . ! 66: These directories are searched automatically by command interpreters. ! 67: .LP ! 68: Section 2 describes ! 69: entries into the ! 70: .UX ! 71: kernel ! 72: as expressed in C, the primary implementation ! 73: language of the system. ! 74: .LP ! 75: Section 3 discusses ! 76: an assortment ! 77: of subroutines, mostly for use with C. ! 78: The primary libraries in which they are kept are described in ! 79: .I intro (3). ! 80: Fortran users should consult the ! 81: .I port (3) ! 82: mathematical library. ! 83: .LP ! 84: Section 4 discusses `files' ! 85: that actually refer to I/O devices, ! 86: processing modules that modify the behavior ! 87: of some devices, ! 88: and `file systems' ! 89: that aren't just files on a disk. ! 90: .LP ! 91: Section 5 gives the structure of particular ! 92: kinds of files, for example, the form of the output of the loader and ! 93: assembler. ! 94: Files internal to only one command ! 95: are excluded, ! 96: for example compiler intermediate files. ! 97: .LP ! 98: Section 6 lists ! 99: macro packages, fonts, mail addressing conventions, etc. ! 100: .LP ! 101: Section 7 is a miscellaneous collection of information sources: ! 102: library orders, news, astronomy, geography, calendar, etc. ! 103: .LP ! 104: Section 8 discusses commands and procedures not intended ! 105: for use by the ordinary user. ! 106: Most of the commands and files described here ! 107: are kept in directory ! 108: .CW /etc. ! 109: .LP ! 110: Section 9 describes software intended for use with the Teletype ! 111: 5620 terminal. ! 112: In this category fall utilities that exploit the terminal and ! 113: tools for writing code to run with or on it. ! 114: .LP ! 115: Appendix A contains information about obsolescent or ! 116: specialized programs. ! 117: It is not printed, but is accessible on line through ! 118: .I man (1). ! 119: .LP ! 120: Not all facilities are available across all computers. ! 121: Pages for programs with limited distribution ! 122: are marked at the top ! 123: with the name of at least one computer ! 124: at the home site where ! 125: they are known to reside. ! 126: .LP ! 127: All pages are based on a common format, ! 128: not all parts of which necessarily appear. ! 129: .RS ! 130: .LP ! 131: The ! 132: .I NAME ! 133: subsection lists the exact names of the commands and subroutines ! 134: covered ! 135: and ! 136: a very short description of their purpose. ! 137: .LP ! 138: The ! 139: .I SYNOPSIS ! 140: subsection summarizes the use of the ! 141: program being described. ! 142: .LP ! 143: The ! 144: .I DESCRIPTION ! 145: subsection discusses in detail the subject at hand. ! 146: .LP ! 147: The ! 148: .I EXAMPLES ! 149: subsection illustrates interesting usage. ! 150: .LP ! 151: The ! 152: .I FILES ! 153: subsection gives the names of files which are ! 154: built into the program. ! 155: .LP ! 156: The ! 157: .I ! 158: SEE ALSO ! 159: .R ! 160: subsection gives pointers to related information. ! 161: .LP ! 162: The ! 163: .I DIAGNOSTICS ! 164: subsection discusses ! 165: the diagnostic indications which may be produced. ! 166: Messages which are intended to be self-explanatory ! 167: are not listed. ! 168: .LP ! 169: The ! 170: .I BUGS ! 171: subsection gives ! 172: known bugs and sometimes deficiencies. ! 173: Occasionally also the suggested fix is ! 174: described. ! 175: .br ! 176: .RE ! 177: .LP ! 178: The following conventions are used, particularly in ! 179: section 1: ! 180: .RS ! 181: .LP ! 182: .CW "Program font" ! 183: shows literals, file names, and examples. ! 184: .LP ! 185: .I Italics ! 186: designate parameters or arguments. ! 187: In descriptions italics also name programs, as a sign that the ! 188: programs can be found described in this manual, and as a reminder ! 189: that the name is probably a shorthand, ! 190: not a real file name. ! 191: .LP ! 192: Square brackets [ ] around an argument ! 193: indicate that the argument is optional. ! 194: .LP ! 195: Ellipses `.\|.\|.' indicate that the previous item ! 196: may be repeated. ! 197: .LP ! 198: A final convention is used by the commands themselves. ! 199: An argument beginning with a minus sign ! 200: .CW - ! 201: usually means a command option ! 202: even if it appears in a position where a file name ! 203: could appear. ! 204: Therefore, it is unwise to have files ! 205: whose names begin with ! 206: .CW - . ! 207: .br ! 208: .RE ! 209: .LP ! 210: Following this introduction are a classified table of contents, ! 211: a permuted index, and a glossary. ! 212: .SH ! 213: HOW TO GET STARTED ! 214: .LP ! 215: This section sketches the basic information ! 216: you need to get started on ! 217: .UX : ! 218: how to log in and log out, ! 219: how to communicate through your terminal, ! 220: and how to run a program. ! 221: See Kernighan and Pike for a more complete introduction. ! 222: .LP ! 223: .I ! 224: Logging in.\ \ ! 225: .R ! 226: You must call ! 227: .UX ! 228: from an appropriate terminal. ! 229: Most any \s8ASCII\s0 terminal capable of full duplex operation and generating ! 230: the entire character set can be used. ! 231: You must also have a valid user name, ! 232: which may be obtained, together with necessary telephone numbers ! 233: or computer names, ! 234: from the system administrator. ! 235: After a data connection is established, ! 236: the login procedure depends on what kind of terminal ! 237: you are using. ! 238: .LP ! 239: .I ! 240: .I ! 241: Dial-up terminals:\ \ ! 242: .R ! 243: If there is a half/full-duplex switch, set it at full-duplex. ! 244: When you have established a data connection, ! 245: the system types out a few characters, intended to be ! 246: .CW login: . ! 247: If they appear as gibberish, the computer is sending at the wrong ! 248: baud rate. ! 249: Depress the `break' ! 250: key; ! 251: this is a signal ! 252: that a different speed terminal ! 253: is in use. ! 254: The system will type ! 255: .CW login: ! 256: at another ! 257: speed. ! 258: Continue depressing the break key ! 259: until ! 260: .CW login: ! 261: appears, then respond with your user name. ! 262: End each line you type with a carriage return. ! 263: .LP ! 264: .I ! 265: Hard-wired terminals.\ \ ! 266: .R ! 267: Hard-wired terminals usually begin at the right ! 268: speed, up to 19200 baud; otherwise the preceding instructions ! 269: apply. ! 270: .LP ! 271: .I ! 272: Datakit\(rg terminals.\ \ ! 273: .R ! 274: Make sure that any on-line/off-line switch is turned to on-line. ! 275: If the terminal types gibberish, depress the `break' key repeatedly ! 276: until you see the prompt ! 277: .CW "Number please:" ! 278: or ! 279: .CW "Destination please:" . ! 280: Respond with the name of the computer you wish to connect to, ! 281: followed by a carriage return. ! 282: When the computer prompts ! 283: .CW login: ! 284: proceed as above. ! 285: .LP ! 286: For all terminals, it is important ! 287: that you type your name in lower case if possible. ! 288: If you type ! 289: upper-case letters, the system ! 290: will assume that your terminal cannot generate lower-case ! 291: letters and will translate all subsequent upper-case ! 292: letters to lower case. ! 293: .LP ! 294: Upon logging in you may be presented with a `message of ! 295: the day'. ! 296: You may also be notified of incoming mail. ! 297: The final evidence that you have successfully ! 298: logged in is that a shell program ! 299: will type a prompt (normally ! 300: .CW $ ) ! 301: to you. ! 302: (The shell is described below under ! 303: `How to run a program.') ! 304: .LP ! 305: Terminals come with a bewildering variety of capabilities, ! 306: which the system may have to be aware of. ! 307: Get somebody who knows to help customize a ! 308: .CW \&.profile ! 309: description of your terminal to set things properly ! 310: upon logging in. ! 311: For more information, consult ! 312: .I sh (1) ! 313: about profiles, ! 314: .I environ (5) ! 315: about environments, and ! 316: .I tabs (1), ! 317: .I stty (1), ! 318: .I tty (4), ! 319: and ! 320: .I ttyld (4) ! 321: about terminal settings. ! 322: .LP ! 323: .I ! 324: Logging out.\ \ ! 325: .R ! 326: There are two ways to log out: ! 327: .IP ! 328: Type an end-of-file indication ! 329: (EOT character, ! 330: control-\f(CWd\fP) ! 331: to the shell. ! 332: The shell will terminate and a ! 333: .CW login: ! 334: or ! 335: .CW "Number please:" ! 336: message ! 337: will appear again. ! 338: .IP ! 339: Simply hang up or turn your terminal off. ! 340: .LP ! 341: .I ! 342: How to communicate through your terminal.\ \ ! 343: .R ! 344: When you type characters, a gnome deep in the system ! 345: gathers your characters and saves them in a secret ! 346: place. ! 347: The ! 348: characters will not be given to a program ! 349: until you type a return. ! 350: .LP ! 351: .UX ! 352: terminal I/O is full-duplex. ! 353: It has full read-ahead, which means that you can ! 354: type at any time, ! 355: even while a program is ! 356: typing at you. ! 357: If you type while the computer is printing, ! 358: the input may appear interleaved with the output. ! 359: However, whatever you type will be saved ! 360: up and interpreted in correct sequence. ! 361: .LP ! 362: In typed input, the character ! 363: .CW @ ! 364: kills all the preceding characters in the line, so ! 365: typing mistakes ! 366: can be repaired. ! 367: Also, the character ! 368: .CW # ! 369: erases the last character typed. ! 370: (Most users prefer to use a backspace rather than ! 371: .CW # ; ! 372: .I stty (1) ! 373: can be used to arrange this.) ! 374: Successive uses of ! 375: .CW # ! 376: erase characters back to, but ! 377: not beyond, the beginning of the line. ! 378: .CW @ ! 379: and ! 380: .CW # ! 381: can be transmitted to a program ! 382: by preceding them with ! 383: .CW \e . ! 384: (So, to erase ! 385: .CW \e , ! 386: you need two ! 387: .CW # s). ! 388: .LP ! 389: The `delete' or `rubout' key causes an ! 390: .I ! 391: interrupt signal, ! 392: .R ! 393: as does the ! 394: `break' key. ! 395: This signal ! 396: generally causes whatever program ! 397: you are running to terminate. ! 398: It is typically used to stop a long printout that ! 399: you don't want (with varying degrees of promptness). ! 400: However, programs can arrange either to ignore ! 401: this signal altogether, ! 402: or to be notified, instead of being killed, when it happens. ! 403: The editor, ! 404: .I ed (1), ! 405: for example, catches interrupts and ! 406: stops what it is doing, ! 407: instead of terminating, so that an interrupt can ! 408: be used to halt an editor printout without ! 409: losing the file being edited. ! 410: .LP ! 411: It is also possible to suspend output temporarily by typing ! 412: control-\f(CWs\fP ! 413: and later resume output with ! 414: control-\f(CWq\fP. ! 415: .LP ! 416: The ! 417: .I quit "" ! 418: signal is generated ! 419: by typing ! 420: control-\f(CW\e\fP ! 421: or ! 422: control-\f(CW|\fP. ! 423: It not only causes a running program to terminate ! 424: but also generates a file with the core image ! 425: of the terminated process. ! 426: Quit is useful ! 427: for debugging. ! 428: .LP ! 429: .I ! 430: How to run a program; the shell.\ \ ! 431: .R ! 432: When you have successfully logged in, a program ! 433: called the shell is listening to your terminal. ! 434: The shell reads typed-in lines, splits them up ! 435: into a command name and arguments, and executes the command. ! 436: A command is simply an executable program, which the ! 437: shell finds by looking in several standard places. ! 438: You can ! 439: place commands in your own directory and have the shell find them there. ! 440: There is nothing special about system-provided ! 441: commands except where they live. ! 442: .LP ! 443: The command name is always the first word on an input line; ! 444: it and its arguments are separated from one another by ! 445: spaces. ! 446: .LP ! 447: When a program terminates, the shell will ordinarily regain control and type ! 448: a prompt at you to indicate that it is ready for another command. ! 449: .LP ! 450: The shell (and the underlying system) has a distinctive ! 451: ability to combine programs by piping the output of one into the ! 452: input of another. ! 453: In general, programs have been designed to be usable in pipelines ! 454: as well as on their own. ! 455: The shell has many other capabilities, which are described in detail in ! 456: .I sh (1). ! 457: .LP ! 458: .I ! 459: Bitmap terminals.\ \ ! 460: .R ! 461: To get the most out of the Tenth Edition system, you will probably ! 462: wish to use a Teletype 5620 or 630 terminal, run with ! 463: .I mux (9.1). ! 464: This provides ! 465: mouse control, graphics, and multiple layers, each of which acts like ! 466: a separate, simultaneously running ! 467: .UX ! 468: terminal, complete with its own shell. ! 469: Text in a ! 470: .I mux ! 471: layer can be edited on screen. ! 472: The editor ! 473: .I sam (9.1) ! 474: and the typesetter simulator ! 475: .I proof (9.1) ! 476: are particularly useful programs that run only under ! 477: .I mux. ! 478: .LP ! 479: .I ! 480: The current directory.\ \ ! 481: .R ! 482: .UX ! 483: has a file system arranged in a hierarchy of directories. ! 484: When you were given a user name by a system administrator, ! 485: you were also given a home directory (ordinarily ! 486: with the same name as your user name). ! 487: When you log in, any file ! 488: name you type is by default ! 489: in this directory. ! 490: Since you are the owner of this directory, you have ! 491: full permission to read, write, alter, or destroy ! 492: its contents. ! 493: Permissions to have your will with other directories ! 494: and files will have been granted or denied to you ! 495: by their owners. ! 496: As a matter of observed fact, few users ! 497: protect their files from perusal by other users. ! 498: .LP ! 499: You need not do all your work in the home directory. ! 500: To switch to another directory use the change directory ! 501: command ! 502: .I cd, ! 503: described in ! 504: .I sh (1). ! 505: .LP ! 506: .I ! 507: Path names.\ \ ! 508: .R ! 509: To refer to files not in the current directory, you must ! 510: use a path name. ! 511: Full path names begin with ! 512: .CW / , ! 513: the name of the `root' of the ! 514: whole file system. ! 515: After the slash comes the name of a subdirectory, another slash ! 516: and a sub-subdirectory, and so on ! 517: until finally a ! 518: file name is reached. ! 519: For example, ! 520: .CW /usr/lem/filex ! 521: refers to the file ! 522: .CW filex ! 523: in the directory ! 524: .CW lem ; ! 525: .CW lem ! 526: is itself a subdirectory of ! 527: .CW usr ; ! 528: .CW usr ! 529: .R ! 530: springs directly from the root. ! 531: .LP ! 532: If your current directory has subdirectories, ! 533: the path names of files therein begin with ! 534: the name of the subdirectory with no initial ! 535: .CW / . ! 536: .LP ! 537: A path name may be used anywhere a file name is ! 538: required. ! 539: .LP ! 540: Important commands which modify the contents of files ! 541: are ! 542: .I cp (1), ! 543: .I mv ! 544: (described in ! 545: .I cp (1)), ! 546: and ! 547: .I rm (1), ! 548: which respectively copy, move (i.e. rename) and remove files. ! 549: To find out the status of files or directories, use ! 550: .I ls (1). ! 551: See ! 552: .I mkdir (1) ! 553: for making directories. ! 554: .LP ! 555: For a fuller discussion of the file system, see ! 556: Kernighan and Pike. ! 557: It may also be useful to glance through ! 558: section 2 of this manual, which discusses ! 559: system calls, even if you don't intend ! 560: to deal with the system at that level. ! 561: .LP ! 562: .I ! 563: Environment.\ \ ! 564: .R ! 565: Many things can be changed in the environment: ! 566: the already-mentioned erase ! 567: character, properties of your terminal, directories from which ! 568: you wish to execute commands, news notification, etc. ! 569: Your ! 570: .CW \&.profile ! 571: file can make these settings automatically upon login. ! 572: .LP ! 573: .I ! 574: Writing a program.\ \ ! 575: .R ! 576: The principal language processors are ! 577: .I cc (1) ! 578: for C, ! 579: .I f77 (1) ! 580: for Fortran, and ! 581: .I awk (1). ! 582: Processors for Basic, Pascal, Snobol, Lisp, Macsyma, ML, and others are available. ! 583: For compile-before-run languages ! 584: enter the text of a source program into a ! 585: file, using one of the editors, ! 586: .I ed (1), ! 587: .I sam (9.1), ! 588: or ! 589: .I vi (1). ! 590: By convention C programs are stored in files with names ! 591: ending in ! 592: .CW .c , ! 593: Fortran programs in ! 594: .CW .f . ! 595: After the program text has been entered through ! 596: the editor ! 597: and written on a file, you can give the file ! 598: to the appropriate language processor as an argument. ! 599: The output of a compiler ! 600: will be left in a file named ! 601: .CW a.out ! 602: in the current directory. ! 603: (If the output is precious, use ! 604: .I mv ! 605: to move it to a less ! 606: exposed name soon.) ! 607: .LP ! 608: When you have finally gone through this entire process ! 609: without provoking any diagnostics, the resulting program ! 610: can be run by giving its name (\c ! 611: .CW a.out ! 612: if you've not arranged otherwise) ! 613: to the shell ! 614: in response to the shell prompt. ! 615: .LP ! 616: Your programs can receive arguments from the command line ! 617: just as system programs do, ! 618: see ! 619: .I exec (2). ! 620: .LP ! 621: .I ! 622: Text processing.\ \ ! 623: .R ! 624: Almost all text is entered through the editors. ! 625: The commands most often used to display text are ! 626: .I cat (1), ! 627: .I pr (1), ! 628: and ! 629: .I troff (1). ! 630: .LP ! 631: The ! 632: .I cat ! 633: command simply dumps text ! 634: on the terminal, with no processing at all. ! 635: The ! 636: .I pr "" ! 637: command paginates the text, supplies headings, ! 638: and has a facility for multi-column output. ! 639: .LP ! 640: .I Troff ! 641: prepares documents for a ! 642: phototypesetter. ! 643: Used naked, it requires careful forethought, but for ! 644: ordinary documents it has been tamed; see ! 645: .I ms (7). ! 646: It was used to produce this manual. ! 647: Its output can drive various devices including ! 648: laser printers and graphic terminals; see ! 649: .I lp (1) ! 650: and ! 651: .I proof (9). ! 652: .LP ! 653: .I ! 654: Status inquiries.\ \ ! 655: .R ! 656: .I Who (1) ! 657: prints a list of users presently logged in. ! 658: .I Date (1) ! 659: prints the current time and date. ! 660: .I Pwd (1) ! 661: tells what directory you're working in; ! 662: .I where , ! 663: described on the same page, ! 664: tells what machine you're on. ! 665: .I Ls (1) ! 666: will list the files in your directory or give ! 667: status information about particular files. ! 668: .LP ! 669: .I ! 670: Surprises.\ \ ! 671: .R ! 672: Certain commands provide inter-user communication. ! 673: Even if you do not plan to use them, it would be ! 674: well to learn something about them, because someone else may ! 675: aim them at you. ! 676: .LP ! 677: To communicate with another user currently logged in, ! 678: .I write (1) ! 679: may be used, but ! 680: .I mail (1) ! 681: is both more polite and more reliable. ! 682: .I Mail ! 683: leaves a message that will be announced ! 684: to another user at next login, if not sooner. ! 685: .I Vismon (9.1) ! 686: and ! 687: .I sh (1) ! 688: provide ways to monitor incoming mail continuously. ! 689: .LP ! 690: .I ! 691: Multiple machines.\ \ ! 692: .R ! 693: Tenth Edition systems have tentacles to many other ! 694: machines. ! 695: The file systems of other ! 696: .UX ! 697: systems may be accessible through ! 698: directory ! 699: .CW /n . ! 700: Thus you may change current directory to one of these machines, although ! 701: computing on your behalf is still being done on the machine you ! 702: logged into. ! 703: You may transmit data among such machines just as within one machine by using ! 704: .I cp (1) ! 705: or I/O redirection in the shell. ! 706: You may also log into a remote machine to do processing there with ! 707: input and output passing through the ! 708: local machine; see ! 709: .I con (1). ! 710: .LP ! 711: Datakit connections exist throughout Bell Laboratories. ! 712: File transmission, over Datakit and over dialup lines to ! 713: even more remote machines, is provided by ! 714: .I uucp (1). ! 715: Mail extends all over the world. ! 716: See ! 717: .I mail (6) ! 718: for how to send mail to destinations on networks such ! 719: as the ARPA Internet, Bitnet, or ACSnet (in Australia.)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.