Essential Unix Project Athena Revision A September 10, 1984 Linda B. Merims Introduction Essential Unix explains the dozen things that you have to know to get through a typical Unix session: those commands that, although they make up only 5% of the total commands available to you, are the commands that you use 80% of the time. When you have finished reading Essential Unix, you will know: how to login and logout what control keys to press to delete a character or bail out of a facility how to get help the Unix command format how to manage Unix files, including how to create them, get lists of them, type them out on the terminal, print them on a line printer, delete them, and control who uses them. what directories are and how to move around them a bit about how to explore and control your Unix environment and how to recognize some of the typical traps that everybody always falls into when they start to use Unix Like its companion documents Essential Athena, Essential Emacs, and Essential Mail, Essential Unix's purpose is to get you on the system and started as quickly as possible. As such, many important Unix concepts such as "pipes" and "redirection" will be ignored or mentioned only in passing because they are not survival material. Lastly, although you may be able to squeak by without it, Essential Unix does assume that you have had some prior exposure to computers so that when we say "file," or "system" you understand in a general way what we mean. First You Need... To use the Project Athena system, you need to know all of the things on the list below. Your project or course Account Administrator should supply you will all of this information. If you have questions about any of this, for example, "What's an Account Administrator?" see the companion document Essential Athena. your Unix username and password You login to the system with your username and password. (Usernames are also referred to as "login ids," "accounts," "userids" and "numbers".) The username is up to eight characters long. Unless you asked for something different, it will be your first and middle initials followed by as much of your last name as will fit in the eight character limit. Usernames are always in all-lowercase letters. your assigned host machine and terminal cluster room number Your username will only work on the host machine assigned to you. All terminals in a terminal cluster can reach your host machine. the combination to the terminal cluster door the cluster telephone number (why?) The cluster terminal rooms are normally open, but you may find one locked. A combination entered into an electronic lock at the side of the door opens the door. Login Go to your assigned terminal cluster. All of the terminals in the clusters have little signs on them that say what host machine they are connected to, their tty (port) address, and what kind of terminal they are. In spite of which host a terminal is labelled with, you can reach your host through any terminal. There are currently five kinds of Athena terminals: DEC VT100's Most of the terminals are VT100's. Go by the Athena sign, @i(not) by the manufacturer's tag on the face of the terminal. DEC PRO 350's These are actually microcomputers acting as terminals. Instructions on the main box explain how to establish contact with the host. They can do graphics. DEC VT125 These look just like the VT100's except that they can graphics. Again, go by the Athena sign, not by the manufacturer's tag. DO NOT use the VT125 terminals unless you are doing graphics output work. They do not work right in other situations. DEC VT240 These terminals can do graphics. DEC VS100 The VS100 bit-mapped graphics units do not work as terminals yet. They can only be used as graphics output devices. Find a terminal and turn it on. In the case of the PRO 350's, follow the connection instructions on the box. Once on, hit the terminal's RETURN key several times until you see the login server banner: Project Athena Login Server (mit-zeus on tty01) 8:35 p.m. on Monday, 2 Jul 1984 Machine name: You want to start out with this banner. If the terminal is already asking for a login return it to the above state by entering CTRL-D or CTRL-C several times. @foot(to enter a "control character" described in documentation as CTRL-c, or control-c, or just ^c, find the key labelled CTRL on the keyboard, hold it down, and while still holding it down, enter the second character. CTRL behaves like a different kind of SHIFT key.) Type in the name of your assigned host (home) machine in all lowercase letters and press RETURN. Next the system will prompt you for your username. Type in your username in all lowercase and press RETURN. Then enter your password, followed by RETURN. Notice that your password is not echoed when you type it. If all goes well, there should be a pause, and then you will see something like: Project Athena Login Server (mit-zeus on tty01) 8:35 p.m. on Monday, 2 Jul 1984 Machine name: hera mit-hera Login: yourlogin Password: Last login: Fri Aug 30 14:07:04 on tty05 4.2 BSD Unix #44: Thur Aug 29 17:28:18 EST 1984 Welcome to Project Athena There will be another long pause, the screen will blank, and then you will see something like: Predestination was doomed from the start. host% The first "welcome" screen shows miscellaneous system information such as the last time you logged in, what version of the system is running, and any broadcast messages that Athena wants everybody to see. If there is personal mail waiting for you, you will see the an additional "You have mail" message at the bottom of the screen. The second screen starts off with a "fortune" that changes each time you login. If there is system news that Athena wants you to look at, then you will see an additional line, "There are system messages." The last line is the Unix system prompt. When you reach this point, you are successfully logged in. The first part of the prompt is the host system you are on, the second part is just a % sign. Whenever you see this prompt it means that the system is waiting for you to type commands. If you try to type anything at login before the system prompt appears it is ignored. Problem: After I typed in my username and hit RETURN it just sat there for a long time. Either your host machine or the connection to it is down. Talk to a consultant. Problem: It says something about there being too many users on or the machine being too busy and won't let me on. To prevent one course from monopolizing all the terminals in a cluster, Athena limits how many people can be logged into a host at one time. Try again later. Problem: Unix just prints "login incorrect." This could be several things. First, are you sure you are talking to the right host? Did you enter a machine name first, or just respond to a login prompt? Enter CTRL-D or CTRL-C and start over. Next, did you specify your username and passwork exactly right (no embedded blanks) as the Account Administrator gave it to you? To try again, just hit RETURN until the login: prompt reappears. If you still can't get on, ask a consultant for help. Logout You must always explicitly logout of your Unix session. You cannot just turn off the terminal and walk away; you will still be logged in. To logout of Unix, enter the command logout in response to the host% prompt. (Athena has disabled the CTRL-D logout that works on some Unix systems.) If your terminal has been idle for about an hour, Unix will log you out automatically. Problems: The system says "There are stopped jobs" or "Not login shell" and doesn't log me out. Or, I am completely stuck and just want to logout. These all have reasonable causes, but it isn't worthwhile explaining what they are right here. The best "emergency bail out" logout to use is: Press the RETURN key type in a ~. (a tilde character followed by a period) and press the RETURN key again This should log you out. If it fails, see a consultant or read below about Killing Sessions. You Have to Know... Once you see the host% prompt, you are logged in and ready to enter commands. However, before we start describing Unix commands, there are a few general facts about the system that you have to know. Control Keys: Fixing Typos, Bailing Out Unix, like other computer systems, has a set of keystrokes that you use to signal conditions that commonly occur as you enter commands and converse with the system. The main ones are: To backup and correct a typing mistake in a command line: the DELETE key. The BACKSPACE (CTRL-H, or ^H key) does not fix typos. Use the DELETE key. On PRO350, VS100, and VT240 terminals, the DELETE key isn't labelled DELETE. It is in the upper right corner of the keyboard just above the RETURN key In Unix parlance, this is called the "erase" character. To cancel a whole line and start over: CTRL-U In Unix, this is called the "kill" character. To bail out of any facility, cancel a command in progress, "get me out of here," "forget it," "stop!": CTRL-C CTRL-C usually works. If one doesn't work, try entering several CTRL-C's. Some facilities do not follow system conventions and CTRL-C doesn't work. A good first alternative to try is q (short for quit). After that, try exit, RETURN CTRL-D, or CTRL-Y, or CTRL-Z. If you are really stuck, see a consultant. Turning off the terminal does not log you out. The CTRL-S, CTRL-Q pause/restart characters that some of you may be familiar with do not work on Project Athena terminals. The NOSCROLL key will appear to work, but it is really isn't. For a substitute, see the discussion of more in the Files section. Case Sensitivity Unix is unusual among operating systems because it is case sensitive: whether a letter is typed in upper- or lowercase makes a difference. The command to list files is ls, not LS. The file readme is different from the file Readme, which is different again from the file README. The command option -p is different from the command option -P. You must train your eye to pay attention to the case of letters and always mimic exactly what you see. Most things in Unix are entered in all-lowercase, like e.e. cummings. Uppercase tends to be used selectively to make something really stand out, or when the lowercase alternative is already being used for something else. Unix's case sensitivity causes a lot of confusion and it is a matter of debate as to whether it is really a "good" feature. Nonetheless, it is the way the system works. Common Terminal Session Problems Here are a few problems that you are likely to run into as you use the system: Problem: \EVERYTHING IS IN UPPERCASE WITH \BACKSLASHES IN IT, EVEN THOUGH \I'M NOT TYPING IN UPPERCASE. When you first logged in, you typed your username in all uppercase. (Maybe the CAPS LOCK key was down by mistake.) Unix has decided that your terminal can only understand all-uppercase letters, so that is all it is sending you. The only fix is to logout, and log back in making sure you give your username in all lowercase. Problem: Everything is dead. Nothing I type shows up on the screen, not even RETURN or CTRL-C. This is usually one of four things, in order of frequency: 1. You accidentally hit the NO SCROLL key on a VT100 terminal keyboard in the lower left corner near the SHIFT and CTRL keys. This tells the terminal to stop showing you data. To start things up again, enter CTRL-Q. 2. Your keyboard has become locked. This often happens if you try to list out a binary file on the terminal, or any other un-printable file by mistake. Hit a few keys and then see if the KBD LOCKED light above the "5" key is lit. If it is, press the SET-UP key slowly twice. This usually clears the condition. 3. Your terminal settings have somehow become confused. Turn the terminal off, then on again. 4. The system on your host machine really is down. To verify this, ask your neighbors how they're doing. Try to login from a different terminal. Tell the consultant on duty. If no consultant is present, call the Athena Hardware Hotline (25)3-1410.