Lab Objectives
|
The computers in the 2nd floor MCSP lab are dual boot, capable of running Windows XP or Ubuntu Linux, an open source version of Linux. Generally you will find them running XP so you will need to reboot into Linux as follows:
After Linux has been loaded you should get a login screen. To log in, enter your username and password (the same that you use to access myRC and email) and press Enter. If you ever have password problems, go to Information Technology on 3rd floor Trexler for assistance. You are now logged into the local machine, but you will be storing your files and running programs from a remote computer (named "CS"). This means that you can use any computer in the lab and still be able to access your personal files.
You should see a desktop environment similar to Windows. This is GNOME,it is responsible for providing a graphical, desktop interface for Linux. Here are some of the basics for getting around in Gnome.
The GNOME panel can be customized by adding and deleting icons and moving them around. In this course we will regularly use three applications: X-terminal windows (for typing in shell commands) Eclipse (for writing programs) and a Text Editor (for providing answers to lab activities). It would be helpful to add icons for these on the panel.
The windows you will use under GNOME will feel much like those under Windows XP. However, there are a couple of tips that you should be aware of. Click on the xterm icon on the Panel to get another xterm window, then use your two windows to get comfortable with these basics:
Moving Windows: As usual, windows can be moved by clicking on the title bar and dragging the window with the mouse. Alternatively, you can hold down ALT and then click anywhere in the window to drag it to a new location. This is particularly handy if the title bar is not visible.
Activating a Window: The window that has a brown title bar is the active window. Only one window can be active at a time. To make another window active, click inside that window or on its titlebar. This will both activate the window and bring it to the front. When you have more than one window open it is often helpful to cycle through them to get to the one you want to work in. The usual way to cycle through windows in GNOME is by pressing Alt-Tab (hold Alt down, then press Tab), just as in Windows XP. Now try ALT-Tab; it should cycle through the windows.
Using Multiple Workspaces: GNOME allows you to have several different workspaces open simultaneously. This is something that you have probably not experienced with a Windows interface. This feature can be useful in grouping together windows that are supporting different tasks. For example, you may want to have one workspace with a terminal window where you are working on your personal web pages and another workspace with a terminal window to work on lab exercises. Alternatively, you may want to have a full-screen browser open in one workspace and Eclipse in another. The GNOME panel shows your workspaces (a grid of 4 rectangles in the right hand corner of the taskbar -- in each rectangle smaller rectangles indicate windows open in that workspace). At this point you should have one workspace open with a window open in it. To change workspaces, just click on the corresponding rectangle.
Using the Command Line Interface
Windowing environments provide a graphical interface to the computer that leverages the strengths of the human perceptual system. We can easily locate and manipulate symbolic representations of our data by using the mouse to point, click and drag. While this kind of operation is highly intuitive, it is not always the most efficient. For this reason, it is sometimes beneficial to interact with the computer system by using descriptive commands that explicitly tell the machine what to do. The command-line interface for Linux systems is accessed through an X-terminal(xterm).
You should already have two xterms open; click on one of the windows to activate it. The program running in the xterm is called the shell. The shell lets you issue commands explicilty to the Linux operating system and work with files. Refer to the Linux Command Reference and Linux/Unix Overview handouts given in class as you answer the following questions and type in the appropriate commands to move around the file system. Pay attention to what happens on the screen after each command.
What is displayed when you type in the command (and press ENTER)?
___________________________________________________
(Note - this should be the full pathname of your home directory.)
cd /
To confirm your hypothesis, you might try typing ls -l (that is an el for
long, not a one) to get a long
listing of the files. This shows you
the permissions on each file (described on the last page of the
Linux/Unix Overview), the ownership of the file (most of these
are root), the size of the file, and the date of last modification
of the file.
Make a careful note about the
permissions that you see there.
ls -l cpMake a note of what happens (especially the permissions).
Setting Up Your Directory
Now we'll set up your directory with some subdirectories and copy some files into them. Do the following:
(see the examples in the Linux Command Reference)
STOP!!! Before going further have the instructor or a lab assistant come over and check to see that you have your directory set up correctly. You will be asked to go to your home directory, show a listing of the files there, then go down into the subdirectories you have created and show what is there.
Editing an existing file
Open the UnixQuestions file using the appropriate menus, icons or keystrokes. Notice that the directories that you created using the command line interface are shown here as folders. Remember that the file you are looking for is in the path: ~/cs120/Labs/lab0 Now, you are ready to edit. As in a word processor you may move around in the buffer with the arrow keys and with the mouse.
First, go to the top of the document and type in your name, then type in the answer to each question immediately following the question. Notice that as soon as you make any change to the document that the filname (both on the window titlebar and in the taskbar) is preceeded by an asterisk (*). This is an indication that you have changed the document but have not saved your work. You should always save your work periodically!
When you finish answering all the questions, save your work and activate the shell window. Use the ls command to list the files in your lab0 directory. You should notice that you have at least two: one is UnixQuestions and the other is UnixQuestions~. The one named UnixQuestions is your most recently saved version of the file; the one with the ~ at the end is an older version of the file (if you only saved once it is the original file that had the questions with no answers).
To print out your answers, use the nenscript command
as follows:
This tells it to print file UnixQuestions to the lab printer. The additional parameters to the print command tell the printer how you would like the document formatted. Specifically, you are asking for 2 columns, rotated to landscape orientation and add a Gaudy title.
Firefox is an open-source web browser that looks and acts much like Internet Explorer, Safari or Netscape. Open Firefox by clicking on the icon on the panel. First, we want to set the class webpage to be your homepage. Under the Edit menu, select Preferences. The preferences dialog will open, and on the right you should see a textbox for Home Page.
If you are in Dr Ingram's class, type in:
http://cs.roanoke.edu/Fall2007/CPSC120A
http://cs.roanoke.edu/Fall2007/CPSC120B
Now go to myrc (http://myrc.roanoke.edu), log in, and go to the Outlook tab. (Alternately: You can go straight to Outlook without going to myRC by going to http://owa.roanoke.edu) Bookmark this link - you will use it every lab to submit your work via e-mail.
Exiting an X-terminal: To exit an xterm, type exit at the command prompt.
Exiting GNOME
To exit GNOME, click on the System option on the panel and choose Log Out. In the next window, select the "Reboot" option if you are through using Linux. The computer will then automatically reboot Windows XP. (If you click the "logout" option the computer will go back to the Linux login screen.)