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