![]() |
|
| Lab 1: Using Unix and a first C program | |
|
Logging in NOTE: This first part, about logging in, using netscape, and learning about Unix, is an optional part of this lab. If you are new to our systems and to Unix, you should take the time to go through this part. In this class we will assume you know the material that this part of the lab covers, and the Unix/Linux textbook is a great reference for finding your way around Unix. You do not have to hand in anything from this part of the lab. At the beginning of lab, the lab instructor should hand you a slip of paper with your username and your initial password, if you are a new student and do not yet have an account in the CS department. Sit at a computer that is one of the group of the computers that the lab instructor has designated. If the screen is blank, hit the <enter> key. Something should appear. If it doesn't tell the lab instructor and find another computer to use. You should either see a login window in the middle of the screen, or
a login prompt in text at the bottom of the screen. At the You should now have a password: prompt, (or if you have a login window, the cursor should be in the password field). Enter your password and hit <enter>. Note that nothing will appear on the screen while you are entering your password (or maybe *'s will appear for each letter you type). If something goes wrong, you will see Login incorrect, and a new login prompt will appear (or in the window the window will just clear and wait for another username in the login window). Try again. If it fails again, contact a lab instructor. When it works, if you logged in through a window, you will eventually see a GUI, a graphical user interface, like Windows or the Mac, but also different. You should have at least one window where a command prompt is waiting for you to type in commands. This window is called a terminal window, and the program controlling the prompt is called a shell. If you logged in on a plain text screen at the bottom of the screen, you need to start the GUI. If you see a prompt that says "Terminal type? [vt100]", Just hit <enter>. If it just says "Terminal type?", type in "vt100" and then hit <enter>. Now you can start the GUI. You do this by typing in startx, and hitting <enter>. You should eventually see that same thing that the person who logged in through a window is seeing. On these machines, when you "logout" or exit the GUI, you are returned to the text-only screen, but you are not yet completely logged out. Don't forget to "logout" after quitting the GUI!!!! If you do not logout from the text screen, someone can come along and erase all your files, or do whatever they want with your account. You logout just by typing "logout" and hitting <enter>. Using the terminal to start Netscape Now, move the mouse pointer around, in and out of your terminal window. You should see the border of the window change color. When the mouse pointer is in the window, the window is active, and you can type commands into it. When it is outside of the window, whatever you type does not go into that window, and the commands aren't executed.Now, let's start Netscape. You do this by pointing to the terminal window, and entering netscape & and hitting <enter>. The ampersand tells the shell not to wait for this command to finish, but to continue to accept other commands right away. Now that you have Netscape running, you can go to the Web pages for this class. In the box near the top of the Netscape window, with Location: in front of it, enter http://www.cs.nmsu.edu/~rth/cs/cs271and hit <enter>. The home page for this class should appear. What is Netscape? Netscape is a browser for the World Wide Web. It lets you look at Web pages -- which are documents that have text and pictures on them. Documents have a name, called a URL, or Universal Resource Locator. This is what is in the Location field, so for our class the URL is http://www.cs.nmsu.edu/~rth/cs/cs271/ Documents can link to one another -- wherever you see underlined text, that text is a pointer to another document. You can go to the other document simply by clicking on the text (the mouse arrow shape changes to a little hand with a finger pointer). There are buttons near the top of Netscape that say back and forward -- these let you go back to your previous documents, or forward as well. Learning about Unix Now it's time to learn more about Unix. We will do this by browsing Web pages and doing some exercises. In the location box, click to bring up the prompt and change the URL to be http://www.cs.nmsu.edu/~jcook/Classes/ This URL has a pointer to the CS271page, but also has pointers to other
things. Near the bottom is a list of pages that are topics explaining Unix.
If Unix is new to you, you should go through all of the pages describing
it. After the first couple of weeks, we will not consider questions about
Unix to be high priority for spending lab time on.
|