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