=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- * UNIX in "N" Lessons * * Part 1 * * by Charles Lin * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- [Please send email to: clin@umd5.umd.edu if there are errors, corrections, or any suggestions for improvement] Copyright 2000 by Charles Lin. All rights reserved. Copyright 1999 by Charles Lin. All rights reserved. (Inspired by the "original" UNIX tutorial co-written by Gwen Kaye, Jandelyn Plane, Larry Herman, and Charles Lin. Revisions: Change aits to dc, add trapuv option; 02-01-01). UNIX in "N" Lessons Series -------------------------- This is a the first part of series of tutorials on UNIX. ------------------------- Lesson 1.0 Background ------------------------- Your Computer Account --------------------- For this class (and nearly every other computer science you take at UMCP which requires programming), you will be assigned a computer account (assuming you are registered. If you already have a WAM account and you use your WAM account all the time, then you are already familiar with a UNIX computer account. You've been using one without possibly realizing it. The computer account that you have been assigned in class is called a "class account". It's very similar to your WAM account, except the account is on a different group of computers than the WAM machines. Your accounts reside on the OIT Unix Cluster. Do not confuse your WAM account with your class account. These two accounts are NOT the same. This means that you can not go to a WAM lab and type in your class account username and password (the one assigned to you in class) and expect to get logged on. In fact, there are no OIT labs that you can directly use your account. However, you can use your account by using your WAM account as well. This means that you should get a WAM account as soon as possible. Everyone who registered in the last year or so should have have been assigned a WAM account as part of the orientation procedure. If you somehow didn't get one, get one right away. Do NOT delay! You can get information about how to get a WAM account at room CSS 1400, which is the OIT Help Desk. They can tell you the procedure for getting a WAM account. Just ask. CSS is in the new wing of the Computer and Space Science Building. What is a Computer Account? --------------------------- As you may have noticed, there are lots of computers on campus. However, there are even more students than computers. Therefore, you can't have a computer on campus reserved specifically for you. You may also notice that students don't carry floppy disks with them to save their files an information, which students used to do many years ago (as recent as 10 years ago). The reason? Students now have computer accounts. When you enter your username and password at a WAM lab workstation, you get access to some disk space. This disk space allows you to store files on disks that are located somewhere on campus, which means you never have to carry disks with you again. Where are you files stored on campus? Doesn't really matter. The computer folks at WAM have handled it for you. It's very similar to having a bank account. Where's your money? Who maintains your balance? Doesn't matter. The bank handles it. Similarly, WAM stores your files somewhere, and all you need to know is that you can access it by getting onto a computer at a WAM lab. Where can you find a WAM lab? There is a complete list of locations on a webpage: http://www.wam.umd.edu/labs.html Use it to find where are the labs are located. Most of the WAM labs are many hours a day, and are available for general student use. When you get a WAM account, you are given both a username and a password. When you get on a computer, you use the username to identify yourself to the computer system. In reality, the computer system really doesn't know who are personally. It just recognizes a username. Suppose your username might be "terpfan". All it knows is the username. However, you should be the only one who has been allowed to use that username. Each student with a WAM account has their own username. To prevent others from accessing your account by typing your username, you have also been given a password. You should be the only person who knows that password. By using that password, you can confirm, to the computer, that you are the actual owner of the username. That way, you should be the only one who accesses your account. Similarly, other people's accounts are protected with their passwords. A computer account is very similar a bank account. When you go to the bank, you have to give the bank your bank account number. This allows the bank teller to access the correct account. You might have to provide a picture ID so the teller can verify that you are who you say you are. That way, someone else doesn't come in to take your money. WAM vs. OIT ----------- As stated earlier, your OIT class account (given in class) is different from your WAM account (you get this yourself). Most of the computers available on campus are available in WAM labs (there are GLUE labs, too, which require a GLUE account---you can get one if you want, but there are more WAM labs available). In order to use the computers in a WAM lab, you must have a WAM account, which means you need to have a WAM username and a WAM password. Using your class account username and password (which will be different from your WAM username and password) will NOT work on WAM machines. So, if you can't use your OIT class account to get onto a WAM computer, how do you access your computer account to do your classwork? Don't worry. We will discuss how to do this later. Even though your WAM account and your OIT class account access different computer systems, there are similarities between the two computer systems. Both run the UNIX operating system. Therefore, to use your class account, you need to master some of the basics of UNIX. As a side benefit, the lessons you learn about UNIX will apply to your WAM account too (and any account that runs on the UNIX operating system). It's the goal of this tutorial to teach you the basics of UNIX. This tutorial ------------- This is a very long tutorial, and will take sometime to read. Every effort has been made to make it reasonably easy to read (which is one reason it is so long). Please spend the hours to read it. You should be able to get through it within two weeks time, but the sooner you master the material, the sooner you can put it to use. It is suggested that you read some of the tutorial, taking down notes whenever you need to, and writing questions down anytime you are confused (so you can ask the teaching staff those questions later on). Then, bring this tutorial, and any notes you may have written, with you to the WAM lab and you can practice UNIX commands on a computer. The best way to learn is to actually use the commands over and over, until it becomes second nature. Your OIT Account ---------------- Make sure you have read the policy concerning your account. In a nutshell, the account is meant to be used for class purposes only. Use your WAM account for personal purposes. Your account will be deleted at the end of the semester after finals are concluded. This means your OIT account is temporary. Your WAM account, however, will be kept active as long as you are still a student at UMCP. You can use your WAM account to store information long term. At the end of the semester, you may ask your instructor how to save any files you wish from your OIT account to your WAM account, if you wish to keep those files long term. What Does OIT Stand For? ------------------------ OIT stands for the Office of Information Technology. Students sometime assume that their instructors maintain their computer accounts. We don't. Instead, OIT manages the computer accounts. Thus, if you delete any files and need to get it recovered, we have to request that OIT does this. Don't contact OIT directly for problems with your computer account. Contact us, and we will contact them for you. What is UNIX? ------------- Ah, finally! This tutorial is going to help you learn how to use UNIX. You're probably wondering, what is UNIX? UNIX is an operating system. So, now you're probably asking, what's an operating system? An operating system is a very complicated program that manages your computer. While you may not have heard of UNIX, you must have heard about Windows. Windows 95, Windows 98, Windows 2000, and Windows NT are all operating systems. MacOS is also an operating system. Nearly every personal computer in use has an operating system that helps run the computer. Even Palm Pilots, which is PDA, run an operating system called PalmOS. What is an operating system? Perhaps it would be easiest to understand by considering an analogy. Imagine you run a business in a city. The city government is similar to an operating system. In order to run a business, you must follow city laws. For example, you need to get permits, keep the place sanitary, etc. In a sense, the city government is also a "business", although it's a more "important" business than the other businesses in town. The government provides businesses two things: city services and law enforcement. City services might include such things as: building and maintaining roads, providing electricity and water, etc. Furthermore, cities also provide law enforcement. Law enforcement prevents one business from trying to ruin another business in illegal ways. Disputes between businesses can be settled by the city government too (though the court system). Like a city government, an operating system also provides services AND provides enforcement. For example, when you run your favorite browser (which is a program) and the browser attempts to access something on the Internet, the operating system is helping to provide access to the network. It offers this service to your browser program. The operating system also tries to prevent programs from trying to "attack" other programs (attacks might mean destroying data, trying to prevent other programs from running, etc.) The operating system also provides some mediation. For example, if two programs want to access the printer at the same time, the operating system can decide which program has access so both don't try to print at the same time causing gibberish to be printed. Why use UNIX? ------------- When most people think about computers, they think about personal computers. Back when personal computers were first being sold (late 1970's to early 1980's), the designers of operating systems, such as Microsoft and Apple, assumed most people who would use computers would use it for one program at a time, and in the privacy of their home. This assumption influenced the way operating systems were designed. As computers got more sophisticated, many of those assumptions, in hindsight, were not very good. Users soon wanted to run more than one program at once, wanted to access their computers away from home, wanted several people to use the same computer, each with an individualized setup. Even as operating systems became more sophisticated, it was hard to get away from the "one user, one computer, no network" mindset. UNIX, on the other hand, started off being used on computers with many users. It was designed to allow many users access to common resources such as files. Furthermore, it was developed at AT&T and University of California, Berkeley, where advanced work on operating systems was being developed. Operating systems used on personal computers were barely operating systems, and only did the bare minimum because home computers were so limited. Because UNIX was meant to work on many machines, and because it's not nearly as proprietary as Windows, it's been a favorite choice among universities, which provides computing services to many students. To be fair, Windows is now a very powerful operating system. However, it has been known to give users grief: it's huge, it's been known to be unstable, and they seemed to have avoided learning any lessons from UNIX when UNIX was one of the most powerful operating systems in use. Even now, it still retains much of the single user, single computers mentality that it originated from. If you've used Windows, UNIX will appear to be rather primitive. Most actions in UNIX still require that you type in commands. In Windows and MacOS, you have nice, fancy GUIs and get to click and drag. By comparison, typing commands seems backwards. Don't be deceived. As you become more familiar with UNIX, you will discover that written text commands actually have a great deal of power, even compared to their flashier GUI cousins. If you consider yourself an expert in Windows or MacOS, please spend the time to master UNIX. Those who are familiar with other operating systems are often reluctant to learn anything new and often feel UNIX is a pain, when in reality, UNIX is just something new, and that's what's making it painful. The field of computers is ever changing and favors the person willing to learn new things. As a UNIX novice and a Windows expert, you will probably do far less on UNIX than Windows. However, you will get better if you try. Take the time to get good at UNIX, because the willingness to learn new things, especially something as useful as UNIX, translates to a willingness to learn other new things. It also looks good on the resume to be an expert on more than one operating system. ----------------------------------- Lesson 1.1: More About Your Account ----------------------------------- The purpose of this tutorial is to get you familiar with the common commands used in UNIX. These commands will help you manage your computer account. For example, you will learn how to look at files, how to copy and move files, how to create directories, etc. Before we start, let's learn more about your computer account. If you are completely new to computers (hopefully, that's not the case), you may wonder what you get with a computer account. Recall that you will be given an OIT Unix account to use for this class and that this account is not the same as your WAM account. You should make sure you get a WAM account, if you haven't already. When you get an account, you will be given some "disk space" which will allow you to save files as well as create directories. This disk space is limited to 5 Megs. This may not seem like much, but it will be more than enough to do your classwork. In order to access your account, you will need a username and a password. Let's briefly define both terms. Username: The "name" you use to identify yourself to a computer Password: A secret word associated with the username, to make sure you are the "user" with the username. This is very similar to using an ATM card. The card identifies who you are to the ATM, and your PIN (personal identification number) is basically a password, making sure you are the owner of that card. Logging On ---------- You will use your username and password to log onto a computer. Here's a definition of "logging on". Logging on: to get onto a particular computer using your username and password. Your OIT class account will allow you to access any of the following computers, which are known as the "detective" cluster (since these are names of detectives). frost.umd.edu, holmes.umd.edu, maigret.umd.edu, marlowe.umd.edu, marple.umd.edu, morse.umd.edu, poirot.umd.edu, tracy.umd.edu wolfe.umd.edu When you are given a username and password, it is for a specific computer system. For example, your WAM account can only be used on the WAM computer system. The WAM account can't be used on computers at, say, the University of Virginia. They run a different computer system. Similarly, your OIT class account only works on the computers listed above (though a few computers more may have been added since this tutorial was written). There's a problem with accessing those computers, however. A Problem: How Can You Log Onto a Detective Cluster Computer? ------------------------------------------------------------- The first question you might ask is: where are the "detective cluster" computers? Well, you can't access those machines directly. That is, there's no room that you can conveniently go to, and log onto, say, frost.umd.edu. You might wonder how you're supposed to get your projects to work if you can't even access the "detective cluster" computers directly. Ah, a problem indeed! Fortunately, there's an indirect way to use those computers. In fact, these indirect ways allow you to access your computer account from home (assuming you have a computer at home with the right kinds of software). An Analogy: Logging On From Other Computers ------------------------------------------- To understand how to log onto a computer indirectly, consider this analogy. Most ATMs are owned by banks. You can withdraw money from the ATMs operated by your bank. Suppose you have an ATM card for Smilie's Bank. However, you see an Emoticon Bank ATM. Can your ATM card work on the Emoticon Bank ATM? These days, it's very common for your ATM cards to work on ATMs that do not belong to your bank. Banks belong to a consortium of banks (such as Cirrus). This allows you to withdraw money from any ATM that is part of the, say, Cirrus system, even if it isn't your bank's ATM. When you use your Smilie bank card on an Emoticon Bank ATM, you don't access an Emoticon bank account. Instead, you get access to the Smilie Bank account despite using an Emoticon ATM. The Emoticon Bank ATM serves as a middleman between you and your account (of course, you are charged a fee for this service). This makes withdrawing money from your account extremely convenient. You can be far away from your bank's nearest ATM and yet still withdraw money from your bank account by using ATMs from other banks that indirectly access your account. Similary, you will access your computer account indirectly. For most of you, this will mean accessing your account from a WAM computer. There are many WAM labs across campus. However, almost all of these computers require that you have a WAM computer account, which means you must have a WAM username and a WAM password. Note: Your OIT class account is NOT the same as your WAM username and WAM password! You will have TWO computer accounts: a WAM computer account and a OIT computer, each with its own username and password. If you do not have a WAM account, get one right away. Unlike your class account, your WAM account will remain with you as long as you are registered as a student (your OIT account will be removed at the end of the semester). Assuming you can log into a WAM computer (using your WAM username and password), the next step is to find the telnet program and use that to log into your OIT class account. This means you will need to "telnet" onto one of the OIT computers (which was listed earlier). However, it's easiest to log onto: dc.umd.edu (pronounced dee-cee-dot-you-em-dee-dot-eee-dee-you). We will explain the instructions for running the telnet program from your WAM account later in the tutorial. Directions for getting onto a WAM computer are listed in a different tutorial (ask the instructional staff which webpage, if you can't find it). What is dc.umd.edu? --------------------- While you can log onto any of the dozen or so machines that make up the detective cluster, most students find it's easier to log onto: dc.umd.edu instead (since you only have to remember one name). dc.umd.edu isn't really a computer (frost.umd.edu, however, is associated with some computer on campus). Instead, when you log onto "dc.umd.edu" (most likely, using the telnet program), one of the detective machines listed above is picked. Presumably, the computer with the fewest students is picked. If you don't know how to log onto one of the computers in a WAM lab, the class webpage will provide instructions for logging onto one of the three kinds of computers that you will find in a WAM lab: PCs, Macs, and Sun workstations. Logging In Outside a WAM lab ---------------------------- For those of you who would like to work off-campus from your home or apartment, or have a computer in your dorm room, the procedure for logging on depends on your computer setup. The class webpage will provide some hints about how to get access to your OIT account. At this point, we will assume that you can, at the very least, get to a computer in one of the WAM labs, and log on. ------------------------------- Lesson 1.2: Logging in ------------------------------- As mentioned earlier, you have been given a computer account on the OIT Unix cluster to do your projects. All projects must compile and run on your OIT account and must be electronically submitted using a program called "submit". We suggest that you use the class account to do all your work. This will help minimize the problems you encounter, and give you opportunities to practice UNIX (and emacs). Some of you have computers at home or at your dorm. You can access your class account as long as you are connected to the network. However, a few of you might have a C or C++ compiler on your computer, and you might already know how to use it. Will you be permitted to use those compilers for the class? We really can't prevent you from using your own compiler to write programs. However, do so at your own risk. The Risks --------- 1. Even if you develop the program using a different compiler (such as Visual C++), you must use the "electronic submit" program to submit the program, and this can only be done from your OIT class account. 2. Your program must compile and run using the cc compiler (on your class account) with the -std1 and -trapuv options. The compiler on your computer and the cc compiler might be slightly different, and if you're not careful, your program might not compile in your class account, and therefore, you would receive a poor grade. 3. You need to figure out how to get your program from your computer to the class account. It's not our job to figure out how to do this for you (though you can ask). 4. Even if you transfer the file successfully, the file may not look the same as it did on your computer (mainly, white space and indentation), so you should look at the program on your class account to see if it looks fine. If you are new to computers, then use your class account. Those who want to use their own computers do so knowing that you have a little more work to do, for the convenience of running it on your own compiler. If you insist on using your own compiler on your computer, then make sure you give yourself at least one day before the due date to transfer the file to your account, test and run it, and reindent the code, if necessary. Again, do not assume that your program will always work perfectly on our machines if it works perfectly on your own compiler. While there are advantages to developing programs on your own computer and then transferring them (you don't need to dial-in, for example), there are advantages developing your code on the UNIX account. * You learn how to use UNIX. Initially, you may feel stupid using UNIX, especially if you are an expert in Windows. However, if you expect to be in the computer field, you need to be willing to learn new things. This is just one way of learning new things. * You get practice using emacs. Since we will test you on emacs (though not much), it's useful to learn how to use it, instead of stubbornly clinging to WordPad or whatever text editor you might use in Windows. * It's as close to using the same environment to test as you can get. We will be running your programs on the OIT machines, which are the same machines you are using to write your programs. Thus, if it compiles and runs on your class account, it should compile and run when we test it (however, you must make sure to test your program thoroughly if you expect it to work under our test cases). Once you get comfortable in the UNIX environment, then you might decide to switch to using your own computer. However, you must use the "submit" program to electronically submit your program from your class account. Programs that are handed in by paper or through email will not be accepted. The "submit" program will be described later on. First Things First: Getting Logged On ------------------------------------- For the time being, let's assume you are on a computer in one of the WAM labs. In order to get to your class account, most of you will need to go to a WAM lab and get on a WAM computer. The process of identifying yourself to the computer using your username and password is called "logging on" (or "logging in"). Logging on allows you to use the computer AND access the files that you may have previously saved. Logging on: To get on a computer, by using your username and password. Unfortunately, WAM labs have three different kinds of computers: Suns, PCs, and Macs. Each computer has a different procedure for logging on. It's usually easiest to pick one brand of machine (either Sun, PCs, or Macs) and use them exclusively. That way, you only have to learn one way of ng ont There are advantages using Suns, but many of you will prefer using PCs. The directions for logging onto one of these machines will be provided on the class webpage. Once you are logged onto your WAM account, you can now get ready to access your class account. Thus, you will log onto the WAM account, and from your WAM account, you will log onto your class account. If you are in the WAM lab using a PC running Windows or a Mac running MacOs, you will need to find the telnet program. On Suns (which also run UNIX), you type the telnet command. Again, the instructions for using the telnet program or the telnet command are provided on a separate class webpage. Notice how you are using the WAM workstation as a "middleman" to log on directly to your class account. Even though are sitting at a WAM machine, you will be accessing and editing files from your class account. This is just like accessing your "Smilie" bank account through an Emoticon ATM. As the instructional staff, we are not responsible for figuring out how to get your computer to access the OIT cluster from computers that are not part of the WAM lab. We only provide instructions for logging onto your OIT account from campus computers located in public WAM facilities. There's just too many different ways to access your class account for us to write everything down. We pick the way that's most common for most students. The rest of you who prefer other ways to access your account (e.g., from home or dorm) will have to get help elsewhere. Getting Help For Dorm/Off-Campus access to WAM accounts ------------------------------------------------------- And there is help available! If you need help accessing your WAM account from your dorm room or from off-campus, you can call the help desk during normal business hours at 405-1500, or send email to helpdesk@umail.umd.edu (if you know out how to use email). You can also get help in person by going directly to the OIT helpdesk, located in room 1400 on the first floor of the Computer and Space Sciences Building. It's in the new wing, on the right, just as you enter the building. They should be able to answer questions about how to get access to your WAM or OIT account from off-campus. Finally....getting logged on! ------------------------------ 1. Log onto a machine in a WAM lab. You will need a WAM account. The course will not provide a WAM account. You can ask instructions on obtaining a WAM account from the OIT help desk (CSS 1400). You should have received a WAM account during orientation. Full directions for how to log on are available on the class webpage. Definition: logging in: to enter in your username and password and get access to your computer account. 2. Find the telnet application. You will want to "connect" to any of the detective machines listed earlier, or simply to: dc.umd.edu. (This is similar to accessing your Smilie bank account from a Emoticon bank ATM). Finding the telnet connection varies from computer to computer, which makes life somewhat tough. Those instructions will be given to you in class and is also located on one of the class webpages. I'll give you directions for logging onto your account assuming you are already on a WAM workstation, and have already managed to log into that (this is assuming a lot, I know). Assuming you are on a Sun Workstation ------------------------------------- Once you get on the machine, put a cursor over a window, and type (start typing at the word "telnet"---the % is the prompt, which should not be typed) % telnet dc.umd.edu Regardless of whether you use a Sun or a PC or Mac, you will see, something very similar to following screen. ------------------------------------------------------------ | Trying 128.8.10.185... | | Connected to dc.umd.edu. | | Escape character is '^]'. | | | | | | Digital UNIX (morse.umd.edu) (ttyp0) | | | | login: | ------------------------------------------------------------ Figure 1: The initial window when you telnet to dc. Notice the line that says "Digital UNIX (morse.umd.edu)". morse.umd.edu is the actual name of the machine you logged onto. Notice that it doesn't say "dc". morse is one of the machines that is part of the detective cluster which falls under the name "dc". This is similar to dialing up a 1-800 number to get customer service for, say, a credit card company. When you call customer service, your call might be answered in one of many different cities like Atlanta, Chicago, Denver, etc. It doesn't matter which city you connect to, since you get help with your credit card account regardless of where the person is from. Similarly, when you type in "telnet dc", it will pick one of the detective machines and begin the login procedure onto that machine. In the example above, typing telnet dc.umd.edu resulted in morse.umd.edu being selected. If you specifically wanted to run on morse.umd.edu, you could have also typed: % telnet morse.umd.edu Generally speaking, it's easier just to remember dc, and let one of the detective computers be selected for you. On the following line, you see is "login" (see Figure 1 above or Figure 2 below). This is a request for you to type in your username. Suppose your OIT username is zz106020. You would type in zz106020 and hit return. Make sure you type your username in lowercase letters. UNIX responds somewhat funny if you type in all-uppercase (it usually begins to print everything in uppercase, which is annoying). Once you have typed in your username and hit return, the screen will look like this. ------------------------------------------------------------- | login: zz106020 | | Password: | ------------------------------------------------------------- Figure 2. What the screen looks like after typing your username. The machine has responded by asking you for your password. Type in your password next, then press the return (or Enter) key. Then, the password ------------------ When you type in the password, you will NOT see anything on the screen. Don't let this bother you. The characters are being read in. Once you have completed the password, hit return. You should be able to hit backspace if you make an error, but it all depends on whether the backspace key is working correctly. You might wonder why the password doesn't show up. It's assumed that you will be working in a public lab where many other people can see your computer. If the password showed up on the screen, then someone else might remember it, and then access your account. Therefore, to prevent someone from finding out your password, the characters aren't printed. Don't let anyone else have access to your password! Giving other students your password is considered an act of academic dishonesty. Suppose you made a mistake, and typed the password incorrectly (this happens a lot, especially to beginners). The screen will now look like this. +-------------------------------------------------------------------------+ | login: zz106020 | | Password: | |(DCE) Unable to validate/certify identity - Invalid password (dce / sec) | | Login incorrect | | login: | +-------------------------------------------------------------------------+ Figure 3. What the screen looks like after typing your username and an incorrect password. You will see "Login incorrect" which lets you know that your password was incorrect. On the following line, you see "login" again. This is a request to re-enter your username again. Make sure to enter your username (NOT the password) again. Initially, you will probably misspell your username or password. Indeed, it may take you several times to get it right (make sure the CAPS LOCK key is off. You should not type in uppercase, unless unless you see an uppercase letter that needs to be typed). With a little practice, you will manage to avoid the mistakes. In the meanwhile, just be aware that most people have problems logging in when they first get started. It's USUALLY typing in the wrong username or password. Make sure to try typing your username and password again whenever you make a mistake. Only when you have tried 4 or 5 times and been unsuccessful should you come in to ask for help. Once you have successfully entered your username and password, you *should* see a shell prompt. What's a shell prompt? A shell prompt is an indication by the shell (which is a program) that it is ready to accept commands that you type in. The job of the shell is to process the commands you type, and the shell indicates it's ready for you to type a command with a shell prompt. By default, the shell prompt is a percent sign. Thus, you would normally see: % At this point, you would begin to type in a UNIX command. Unfortunately, after logging into your class account, you won't see the shell prompt right away. Instead you will see other annoying things about setting up news and reading mail. You will need to get past this to get to the shell prompt so you can begin to type in UNIX commands. We'll tell you how to do this later on. For the time being, assume that you have managed to get to the shell prompt. That is, assume that you see a % sign indicating that the shell is ready to accept commands. What is the shell? ------------------ When you log on, you will be interacting with a shell. A shell is a program which process commands. You type in a UNIX command, and the shell "carries" out the command. In fact, the shell is more of a "middleman" which passes your requests onto UNIX, the operating system. There are many different kinds of UNIX shells, each with its own prompt. Your class account has been set up with the C-shell (also written as csh, and pronounced as "seashell"). Despite the name, the C-shell has very little to do with C, the programming language. As you become more proficient in UNIX, you may wish to use a different shell, which provide more powerful capabilities. Your first UNIX command: logout ------------------------------- The first UNIX command you will learn is how to logout. At this point, assume you are already logged in, and are seeing the shell prompt. The shell is waiting for you to type in a command. Type in "logout" when you see the prompt and hit the return key (all commands that you type require that you hit the return key in order for the command to be run). % logout Logging out is important! Once you are done using your account and wish to leave the computer, you should log out. Logging out is similar to hanging up the phone. If you don't hang up the phone, other people could pick it up and start talking. While it may be silly to forget to hang up a phone, it's very common for people to forget to log out of a computer. Make sure you log out. Other people could use your computer account if you do not logout. Logging out closes your account and makes it inaccessible. The only way to get back into an account is to log back in again. You will often have to log out TWICE. You will need to log out of your class account, THEN log out of your WAM account. However, in most cases, logging out of your WAM account will automatically cause you to log out of your class account (assuming you used your WAM account to access your class account, that is). Test Your Understanding ----------------------- 1. What does logging in mean? 2. What two things must you type to log in? 3. After you have successfully logged in, you will see a shell prompt. What does the shell prompt indicate? 4. What symbol is used for the C-shell prompt? 5. What is the UNIX command to log out. 6. What does logging out mean? ------------------------------------- Lesson 1.3: Basic UNIX command syntax ------------------------------------- When you learn about UNIX, you learn how to type in "commands" to make UNIX carry out useful tasks. Unlike, say, Windows, there's not much clicking and dragging going on. You have to type in commands. Most UNIX commands use the following "syntax":