|
|
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: A backspace
368: erases the last character typed.
369: Successive backspaces
370: erase characters back to, but
371: not beyond, the beginning of the line.
372: .CW @
373: and backspace can be transmitted to a program
374: by preceding them with
375: .CW \e .
376: (So, to erase
377: .CW \e ,
378: you need two backspaces.)
379: .LP
380: The `delete' or `rubout' key causes an
381: .I
382: interrupt signal,
383: .R
384: as does the
385: `break' key.
386: This signal
387: generally causes whatever program
388: you are running to terminate.
389: It is typically used to stop a long printout that
390: you don't want (with varying degrees of promptness).
391: However, programs can arrange either to ignore
392: this signal altogether,
393: or to be notified, instead of being killed, when it happens.
394: The editor,
395: .I ed (1),
396: for example, catches interrupts and
397: stops what it is doing,
398: instead of terminating, so that an interrupt can
399: be used to halt an editor printout without
400: losing the file being edited.
401: .LP
402: It is also possible to suspend output temporarily by typing
403: control-\f(CWs\fP
404: and later resume output with
405: control-\f(CWq\fP.
406: .LP
407: The
408: .I quit ""
409: signal is generated
410: by typing
411: control-\f(CW\e\fP
412: or
413: control-\f(CW|\fP.
414: It not only causes a running program to terminate
415: but also generates a file with the core image
416: of the terminated process.
417: Quit is useful
418: for debugging.
419: .LP
420: .I
421: How to run a program; the shell.\ \
422: .R
423: When you have successfully logged in, a program
424: called the shell is listening to your terminal.
425: The shell reads typed-in lines, splits them up
426: into a command name and arguments, and executes the command.
427: A command is simply an executable program, which the
428: shell finds by looking in several standard places.
429: You can
430: place commands in your own directory and have the shell find them there.
431: There is nothing special about system-provided
432: commands except where they live.
433: .LP
434: The command name is always the first word on an input line;
435: it and its arguments are separated from one another by
436: spaces.
437: .LP
438: When a program terminates, the shell will ordinarily regain control and type
439: a prompt at you to indicate that it is ready for another command.
440: .LP
441: The shell (and the underlying system) has a distinctive
442: ability to combine programs by piping the output of one into the
443: input of another.
444: In general, programs have been designed to be usable in pipelines
445: as well as on their own.
446: The shell has many other capabilities, which are described in detail in
447: .I sh (1).
448: .LP
449: .I
450: Bitmap terminals.\ \
451: .R
452: To get the most out of the Tenth Edition system, you will probably
453: wish to use a Teletype 5620 or 630 terminal, run with
454: .I mux (9.1).
455: This provides
456: mouse control, graphics, and multiple layers, each of which acts like
457: a separate, simultaneously running
458: .UX
459: terminal, complete with its own shell.
460: Text in a
461: .I mux
462: layer can be edited on screen.
463: The editor
464: .I sam (9.1)
465: and the typesetter simulator
466: .I proof (9.1)
467: are particularly useful programs that run only under
468: .I mux.
469: .LP
470: .I
471: The current directory.\ \
472: .R
473: .UX
474: has a file system arranged in a hierarchy of directories.
475: When you were given a user name by a system administrator,
476: you were also given a home directory (ordinarily
477: with the same name as your user name).
478: When you log in, any file
479: name you type is by default
480: in this directory.
481: Since you are the owner of this directory, you have
482: full permission to read, write, alter, or destroy
483: its contents.
484: Permissions to have your will with other directories
485: and files will have been granted or denied to you
486: by their owners.
487: As a matter of observed fact, few users
488: protect their files from perusal by other users.
489: .LP
490: You need not do all your work in the home directory.
491: To switch to another directory use the change directory
492: command
493: .I cd,
494: described in
495: .I sh (1).
496: .LP
497: .I
498: Path names.\ \
499: .R
500: To refer to files not in the current directory, you must
501: use a path name.
502: Full path names begin with
503: .CW / ,
504: the name of the `root' of the
505: whole file system.
506: After the slash comes the name of a subdirectory, another slash
507: and a sub-subdirectory, and so on
508: until finally a
509: file name is reached.
510: For example,
511: .CW /usr/lem/filex
512: refers to the file
513: .CW filex
514: in the directory
515: .CW lem ;
516: .CW lem
517: is itself a subdirectory of
518: .CW usr ;
519: .CW usr
520: .R
521: springs directly from the root.
522: .LP
523: If your current directory has subdirectories,
524: the path names of files therein begin with
525: the name of the subdirectory with no initial
526: .CW / .
527: .LP
528: A path name may be used anywhere a file name is
529: required.
530: .LP
531: Important commands which modify the contents of files
532: are
533: .I cp (1),
534: .I mv
535: (described in
536: .I cp (1)),
537: and
538: .I rm (1),
539: which respectively copy, move (i.e. rename) and remove files.
540: To find out the status of files or directories, use
541: .I ls (1).
542: See
543: .I mkdir (1)
544: for making directories.
545: .LP
546: For a fuller discussion of the file system, see
547: Kernighan and Pike.
548: It may also be useful to glance through
549: section 2 of this manual, which discusses
550: system calls, even if you don't intend
551: to deal with the system at that level.
552: .LP
553: .I
554: Environment.\ \
555: .R
556: Many things can be changed in the environment:
557: the already-mentioned erase
558: character, properties of your terminal, directories from which
559: you wish to execute commands, news notification, etc.
560: Your
561: .CW \&.profile
562: file can make these settings automatically upon login.
563: .LP
564: .I
565: Writing a program.\ \
566: .R
567: The principal language processors are
568: .I cc (1)
569: for C,
570: .I f77 (1)
571: for Fortran, and
572: .I awk (1).
573: Processors for Basic, Pascal, Snobol, Lisp, Macsyma, ML, and others are available.
574: For compile-before-run languages
575: enter the text of a source program into a
576: file, using one of the editors,
577: .I ed (1),
578: .I sam (9.1),
579: or
580: .I vi (1).
581: By convention C programs are stored in files with names
582: ending in
583: .CW .c ,
584: Fortran programs in
585: .CW .f .
586: After the program text has been entered through
587: the editor
588: and written on a file, you can give the file
589: to the appropriate language processor as an argument.
590: The output of a compiler
591: will be left in a file named
592: .CW a.out
593: in the current directory.
594: (If the output is precious, use
595: .I mv
596: to move it to a less
597: exposed name soon.)
598: .LP
599: When you have finally gone through this entire process
600: without provoking any diagnostics, the resulting program
601: can be run by giving its name (\c
602: .CW a.out
603: if you've not arranged otherwise)
604: to the shell
605: in response to the shell prompt.
606: .LP
607: Your programs can receive arguments from the command line
608: just as system programs do,
609: see
610: .I exec (2).
611: .LP
612: .I
613: Text processing.\ \
614: .R
615: Almost all text is entered through the editors.
616: The commands most often used to display text are
617: .I cat (1),
618: .I pr (1),
619: and
620: .I troff (1).
621: .LP
622: The
623: .I cat
624: command simply dumps text
625: on the terminal, with no processing at all.
626: The
627: .I pr ""
628: command paginates the text, supplies headings,
629: and has a facility for multi-column output.
630: .LP
631: .I Troff
632: prepares documents for a
633: phototypesetter.
634: Used naked, it requires careful forethought, but for
635: ordinary documents it has been tamed; see
636: .I ms (7).
637: It was used to produce this manual.
638: Its output can drive various devices including
639: laser printers and graphic terminals; see
640: .I lp (1)
641: and
642: .I proof (9).
643: .LP
644: .I
645: Status inquiries.\ \
646: .R
647: .I Who (1)
648: prints a list of users presently logged in.
649: .I Date (1)
650: prints the current time and date.
651: .I Pwd (1)
652: tells what directory you're working in;
653: .I where ,
654: described on the same page,
655: tells what machine you're on.
656: .I Ls (1)
657: will list the files in your directory or give
658: status information about particular files.
659: .LP
660: .I
661: Surprises.\ \
662: .R
663: Certain commands provide inter-user communication.
664: Even if you do not plan to use them, it would be
665: well to learn something about them, because someone else may
666: aim them at you.
667: .LP
668: To communicate with another user currently logged in,
669: .I write (1)
670: may be used, but
671: .I mail (1)
672: is both more polite and more reliable.
673: .I Mail
674: leaves a message that will be announced
675: to another user at next login, if not sooner.
676: .I Vismon (9.1)
677: and
678: .I sh (1)
679: provide ways to monitor incoming mail continuously.
680: .LP
681: .I
682: Multiple machines.\ \
683: .R
684: Tenth Edition systems have tentacles to many other
685: machines.
686: The file systems of other
687: .UX
688: systems may be accessible through
689: directory
690: .CW /n .
691: Thus you may change current directory to one of these machines, although
692: computing on your behalf is still being done on the machine you
693: logged into.
694: You may transmit data among such machines just as within one machine by using
695: .I cp (1)
696: or I/O redirection in the shell.
697: You may also log into a remote machine to do processing there with
698: input and output passing through the
699: local machine; see
700: .I con (1).
701: .LP
702: Datakit connections exist throughout Bell Laboratories.
703: File transmission, over Datakit and over dialup lines to
704: even more remote machines, is provided by
705: .I uucp (1).
706: Mail extends all over the world.
707: See
708: .I mail (6)
709: for how to send mail to destinations on networks such
710: 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.