document for 4.3BSD release
[unix-history] / usr / src / share / doc / usd / 01.begin / u1
CommitLineData
d5531582 1.\" @(#)u1 6.1 (Berkeley) %G%
de3c30a1
KD
2.\"
3.nr PS 9
4.if t .nr VS 11
5.if n .ls 2
6.if t .2C
7.nr PI .25i
8.SH
9INTRODUCTION
10.PP
11From the user's point of view,
12the
13.UC UNIX
14operating system
15is easy
16to learn and use,
17and presents few of the usual impediments
18to getting the job done.
19It is hard, however, for the beginner
20to know where to start,
21and how to make the best use
22of the facilities available.
23The purpose of this introduction
24is to help new users
25get used to the main ideas of
26the
27.UC UNIX
28system
29and start making effective use of it quickly.
30.PP
31You should have a couple of other documents with you
32for easy reference as you read this one.
33The most important is
34.ul
35The
36.ul
37.UC UNIX
38.IT Programmer's
39.IT Manual \|;
40it's often easier to tell you to read about something
41in the manual
42than to repeat its contents here.
43The other useful document is
44.ul
45A Tutorial Introduction to the
46.ul
47.UC UNIX
48.ul
49Text Editor,
50which will tell you how to use the editor
51to get text \(em
52programs, data, documents \(em
53into the computer.
54.PP
55A word of warning:
56the
57.UC UNIX
58system
59has become quite popular,
60and there are several major variants
61in widespread use.
62Of course details also change with time.
63So although the basic structure of
64.UC UNIX
65and how to use it is common to all versions,
66there will certainly be a few things
67which are different on your system from
68what is described here.
69We have tried to minimize the problem,
70but be aware of it.
71In cases of doubt,
72this paper describes Version 7
73.UC UNIX .
74.PP
75This paper has five sections:
76.IP "\ \ 1."
77Getting Started:
78How to log in,
79how to type,
80what to do about mistakes in typing,
81how to log out.
82Some of this is dependent on which
83system
84you log into
85(phone numbers, for example)
86and what terminal you use,
87so this section must necessarily be supplemented
88by local information.
89.IP "\ \ 2."
90Day-to-day Use:
91Things you need every day to use
92the system
93effectively:
94generally useful commands;
95the file system.
96.IP "\ \ 3."
97Document Preparation:
98Preparing manu\%scripts is one of the most common uses
99for
100.UC UNIX
101systems.
102This section contains advice,
103but not
104extensive instructions on any
105of the formatting tools.
106.IP "\ \ 4."
107Writing Programs:
108.UC UNIX
109is an excellent system for developing programs.
110This section talks about some of the tools,
111but again is not a tutorial in any of the programming languages
112provided by the system.
113.IP "\ \ 5."
114A
115.UC UNIX
116Reading List.
117An annotated bibliography of
118documents that new users should be aware of.
119.SH
120I. GETTING STARTED
121.SH
122Logging In
123.PP
124You must have a
125.UC UNIX
126login name, which you can get from
127whoever administers your system.
128You also need to know the phone number,
129unless your system uses permanently connected terminals.
130The
131.UC UNIX
132system
133is capable of dealing with a wide variety of terminals:
134Terminet 300's; Execuport, TI and similar
135portables;
136video (CRT) terminals like the HP2640, etc.;
137high-priced graphics terminals like the Tektronix 4014;
138plotting terminals like those from GSI and DASI;
139and even the venerable
140Teletype in its various forms.
141But note:
142.UC UNIX
143is strongly oriented towards devices with
144.ul
145lower case.
146If your terminal produces only upper case (e.g., model 33 Teletype, some video and portable terminals),
147life will be so difficult that you should look for another
148terminal.
149.PP
150Be sure to set the switches appropriately on your device.
151Switches that might need to be adjusted include the speed,
152upper/lower case mode,
153full duplex, even parity, and any others
154that local wisdom advises.
155Establish a connection using whatever
156magic is needed for your terminal;
157this may involve dialing a telephone call or merely flipping a switch.
158In either case,
159.UC UNIX
160should type
161.UL login: '' ``
162at you.
163If it types garbage, you may be at the wrong speed;
164check the switches.
165If that fails,
166push the ``break'' or ``interrupt'' key a few times, slowly.
167If that fails to produce a login message, consult a guru.
168.PP
169When you get a
170.UL login:
171message,
172type your
173login name
174.ul
175in lower case.
176Follow it by a
177.UC RETURN ;
178the system will not do anything until you type a
179.UC RETURN .
180If a password is required,
181you will be asked for it,
182and (if possible)
183printing will be turned off while you type it.
184Don't forget
185.UC RETURN .
186.PP
187The culmination of your login efforts is a
188``prompt character,''
189a single character that indicates that
190the system
191is ready to accept commands from you.
192The prompt character is usually a
193dollar sign
194.UL $
195or a
196percent sign
197.UL % .
198(You may also get a message of the day just before the
199prompt character, or a notification that you have mail.)
200.SH
201Typing Commands
202.PP
203Once you've seen the prompt character, you can type commands,
204which are
205requests that
206the system
207do something.
208Try typing
209.P1
210date
211.P2
212followed by
213.UC RETURN.
214You should get back something like
215.P1
216Mon Jan 16 14:17:10 EST 1978
217.P2
218Don't forget the
219.UC RETURN
220after the command,
221or nothing will happen.
222If you think you're being ignored,
223type a
224.UC RETURN ;
225something should happen.
226.UC RETURN
227won't be mentioned
228again,
229but don't forget it \(em
230it has to be there
231at the end of each line.
232.PP
233Another command you might try is
234.UL who ,
235which tells you everyone who is currently logged in:
236.P1
237who
238.P2
239gives something like
240.P1
241.ta .5i 1i
242mb tty01 Jan 16 09:11
243ski tty05 Jan 16 09:33
244gam tty11 Jan 16 13:07
245.P2
246The time is when the user logged in;
247``ttyxx'' is the system's idea of what terminal
248the user is on.
249.PP
250If you make a mistake typing the command name,
251and refer to a non-existent command,
252you will be told.
253For example, if you type
254.P1
255whom
256.P2
257you will be told
258.P1
259whom: not found
260.P2
261Of course, if you inadvertently type the name of some other command,
262it will run,
263with more or less mysterious results.
264.SH
265Strange Terminal Behavior
266.PP
267Sometimes you can get into a state
268where your terminal acts strangely.
269For example,
270each letter may be typed twice,
271or the
272.UC RETURN
273may not cause a line feed
274or a return to the left margin.
d5531582
KD
275You can often fix this by logging out and logging back in.\(dg
276.FS
277\(dg In Berkeley Unix, the command "reset<control-j>"
278will often reset a terminal apparently in a strange state because a fullscreen
279editor crashed.
280.FE
281.FE
de3c30a1
KD
282Or you can read the description of the command
283.UL stty
d5531582 284in section 1 of the manual.
de3c30a1
KD
285To get intelligent treatment of
286tab characters
287(which are much used in
288.UC UNIX )
289if your terminal doesn't have tabs,
290type the command
291.P1
292stty \-tabs
293.P2
294and the system will convert each tab into the right number
295of blanks for you.
296If your terminal does have computer-settable tabs,
297the command
298.UL tabs
299will set the stops correctly for you.
300.SH
301Mistakes in Typing
302.PP
303If you make a typing mistake, and see it before
304.UC RETURN
305has been typed,
306there are two ways to recover.
307The sharp-character
308.UL #
309erases the last character typed;
310in fact successive uses of
311.UL #
312erase characters back to
313the beginning of the line (but not beyond).
314So if you type badly, you can correct as you go:
315.P1
316dd#atte##e
317.P2
318is the same as
d5531582
KD
319.UL date .\(dd
320.FS
321\(dd Many installations set the erase character for display terminals to
322the delete or backspace key. "stty all" tells you what it actually is.
323.FE
de3c30a1
KD
324.PP
325The at-sign
326.UL @
327erases all of the characters
328typed so far
329on the current input line,
330so if the line is irretrievably fouled up, type an
331.UL @
332and start the line over.
333.PP
334What if you must enter a sharp or at-sign
335as part of the text?
336If you precede either
337.UL #
338or
339.UL @
340by a backslash
341.UL \e ,
342it loses its erase meaning.
343So to enter a sharp or at-sign in something, type
344.UL \e#
345or
346.UL \e@ .
347The system will always echo a newline at you after your at-sign,
348even if preceded by a backslash.
349Don't worry \(em
350the at-sign has been recorded.
351.PP
352To erase a backslash,
353you have to type two sharps or two at-signs, as in
354.UL \e## .
355The backslash is used extensively in
356.UC UNIX
357to indicate that the following character is in some way special.
358.SH
359Read-ahead
360.PP
361.UC UNIX
362has full read-ahead,
363which means that you can type as fast as you want,
364whenever you want,
365even when some command is typing at you.
366If you type during output,
367your input characters will appear intermixed with the output characters,
368but they will be stored away
369and interpreted in the correct order.
370So you can type several commands one after another without
371waiting for the first to finish or even begin.
372.SH
373Stopping a Program
374.PP
375You can stop most programs by
376typing the character
377.UC DEL '' ``
378(perhaps called ``delete'' or ``rubout'' on your terminal).
379The ``interrupt'' or ``break'' key found on most terminals
d5531582
KD
380can also be used.\(dg
381.FS
382\(dg In Berkeley Unix, "control-c" is the usual way to stop programs. "stty all"
383tells you the value of your "intr" key.
384.FE
de3c30a1
KD
385In a few programs, like the text editor,
386.UC DEL
387stops whatever the program is doing but leaves you in that program.
d5531582
KD
388Hanging up the phone will stop most programs.\(dd
389.FS
390\(dd If you use the c shell, programs running in the background continue
391running even if you hang up.
392.FE
de3c30a1
KD
393.SH
394Logging Out
395.PP
396The easiest way to log out is to hang up the phone.
397You can also type
398.P1
399login
400.P2
d5531582
KD
401and let someone else use the terminal you were on.*
402.FS
403* "control-d" and "logout" are other alternatives.
404.FE
de3c30a1
KD
405It is usually not sufficient just to turn off the terminal.
406Most
407.UC UNIX
408systems
409do not use a time-out mechanism, so you'll be
410there forever unless you hang up.
411.SH
412Mail
413.PP
414When you log in, you may sometimes get the message
415.P1
416You have mail.
417.P2
418.UC UNIX
419provides a postal system so you can
420communicate with
421other users of the system.
422To read your mail,
423type the command
424.P1
425mail
426.P2
427Your mail will be printed,
428one message at a time,
d5531582
KD
429most recent message first.\(dd
430.FS
431\(dd The Berkeley mail program lists the headers of some number of unread pieces
432of mail in the order of their receipt.
433.FE
de3c30a1
KD
434After each message,
435.UL mail
436waits for you to say what to do with it.
437The two basic responses are
438.UL d ,
439which deletes the message,
440and
441.UC RETURN ,
442which does not
443(so it will still be there the next time you read your mailbox).
444Other responses are described in the manual.
445(Earlier versions of
446.UL mail
447do not process one message at a time,
448but are otherwise similar.)
449.PP
450How do you send mail to someone else?
451Suppose it is to go to ``joe'' (assuming ``joe'' is someone's login name).
452The easiest way is this:
453.P1
454mail joe
455.ft I
456now type in the text of the letter
457on as many lines as you like ...
458After the last line of the letter
459type the character ``control-d'',
460that is, hold down ``control'' and type
461a letter ``d''.
462.P2
463And that's it.
464The ``control-d'' sequence, often called ``EOF'' for end-of-file, is used throughout
465the system
466to mark the end of input from a terminal,
467so you might as well get used to it.
468.PP
469For practice, send mail to yourself.
470(This isn't as strange as it might sound \(em
471mail to oneself is a handy reminder mechanism.)
472.PP
473There are other ways to send mail \(em
474you can send a previously prepared letter,
475and you can mail to a number of people all at once.
476For more details see
477.UL mail (1).
478(The notation
479.UL mail (1)
480means the command
481.UL mail
482in section 1
483of the
484.ul
485.UC UNIX
486.ul
487.IT Programmer's
488.IT Manual .)
489.SH
d5531582
KD
490Writing to other users\(dg
491.FS
492\(dg Although "write" works on Berkeley
493.UC UNIX,
494there is a much nicer way of communicating using display-terminals \(em
495"talk" splits the screen into two sections, and both of you can type
496simultaneously (see talk(1)).
497.FE
de3c30a1
KD
498.PP
499At some point,
500out of the blue will come a message
501like
502.P1
503Message from joe tty07...
504.P2
505accompanied by a startling beep.
506It means that Joe wants to talk to you,
507but unless you take explicit action you won't be able to talk back.
508To respond,
509type the command
510.P1
511write joe
512.P2
513This establishes a two-way communication path.
514Now whatever Joe types on his terminal will appear on yours
515and vice versa.
516The path is slow, rather like talking to the moon.
517(If you are in the middle of something, you have to
518get to a state where you can type a command.
519Normally, whatever program you are running has to terminate or be terminated.
520If you're editing, you can escape temporarily from the editor \(em
521read the editor tutorial.)
522.PP
523A protocol is needed to keep what you type from getting
524garbled up with what Joe types.
525Typically it's like this:
526.P1
527.tr --
528.fi
529.ft R
530Joe types
531.UL write
532.UL smith
533and waits.
534.br
535Smith types
536.UL write
537.UL joe
538and waits.
539.br
540Joe now types his message
541(as many lines as he likes).
542When he's ready for a reply, he
543signals it by typing
544.UL (o) ,
545which
546stands for ``over''.
547.br
548Now Smith types a reply, also
549terminated by
550.UL (o) .
551.br
552This cycle repeats until
553someone gets tired; he then
554signals his intent to quit with
555.UL (oo) ,
556for ``over
557and out''.
558.br
559To terminate
560the conversation, each side must
561type a ``control-d'' character alone
562on a line. (``Delete'' also works.)
563When the other person types his ``control-d'',
564you will get the message
565.UL EOF
566on your terminal.
567.P2
568.PP
569If you write to someone who isn't logged in,
570or who doesn't want to be disturbed,
571you'll be told.
572If the target is logged in but doesn't answer
573after a decent interval,
574simply type ``control-d''.
575.SH
576On-line Manual
577.PP
578The
579.ul
580.UC UNIX
581.ul
582Programmer's Manual
583is typically kept on-line.
584If you get stuck on something,
585and can't find an expert to assist you,
586you can print on your terminal some manual section that might help.
587This is also useful for getting the most up-to-date
588information on a command.
589To print a manual section, type
590``man command-name''.
591Thus to read up on the
592.UL who
593command,
594type
595.P1
596man who
597.P2
598and, of course,
599.P1
600man man
601.P2
602tells all about the
603.UL man
604command.
605.SH
606Computer Aided Instruction
607.PP
608Your
609.UC UNIX
610system may have available
611a program called
612.UL learn ,
613which provides computer aided instruction on
614the file system and basic commands,
615the editor,
616document preparation,
617and even C programming.
618Try typing the command
619.P1
620learn
621.P2
622If
623.UL learn
624exists on your system,
625it will tell you what to do from there.