The Login Process:
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:
If you have problems logging in, make sure that you are entering the correct user name and password. 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 part of the file system you will be using has been mounted from Linux servers (that is, you will be storing your files and using programs on the Linux servers). You should see a desktop environment similar to Windows. This is GNOME, one of the most popular desktop environments for Linux. A separate window management program is running in conjunction with GNOME but we will loosely refer to everything in the windowing environment as GNOME. Here are some basics for getting around in GNOME:
Managing GNOME Windows
The windows you will use under GNOME will feel much like those under Windows 98, 2000, NT, or XP although a few things are different. Click on the xterm (terminal) 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.
Resizing Windows: To resize a window, point to a corner, hold down the mouse button and drag the corner. The middle button (with a picture of a half-filled-in square) in the upper right hand corner can also be used to maximize the window (make it fill the whole screen) and then to change it back to the original size.
Minimizing Windows: To minimize a window, click the leftmost button (with a picture of a line at the bottom) in the upper right hand corner of the window. Note that for minimized windows the icons on the taskbar at the bottom of the screen are greyed out.
Closing Windows: To close a window, click the rightmost button (with a picture of an X) in the upper right hand corner of the window. Generally you won't want so many of the same type of window open so close some of the terminal windows.
Using Multiple Workspaces: GNOME allows you to have several different workspaces open simultaneously. For example, later in the course 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. Or, you may want to have your browser open in one workspace, the emacs editor in another, or whatever. 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 rectangle.
Moving Around the Linux File System
Now that you can get around the window environment, let's take a look at an xterm. Click on one of the terminal windows to activate it. The program running in the xterm is called the shell. The shell lets you issue commands to the Linux operating system and work with files. Refer to the handouts on the shell commands and Unix files 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.
ls -l cpMake a note of what happens.
Setting Up Your Directory
Now we'll set up your directory with some subdirectories and copy some files into them. Do the following:
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
We'll first use Emacs to edit the UnixQuestions file. To open this file in your lab0 subdirectory do the following:
A useful Emacs command: If you ever get stuck halfway into an Emacs command, where the minibuffer is asking for something that you don't understand, type C-g (hold down the ctrl key then hit the g key). This aborts the current command.
Now go to the top of the document and type in your name, then type in the answer to each question immediately following the question.
Save the file by typing C-x C-s (hold down the ctrl key then hit the x key, then release the x key while still holding the ctrl key and hit the s key) OR choose File, then Save (current buffer) from the menu.
Activate the shell window and use the nenscript command to
print out your answers. The command is as follows:
This tells it to print file UnixQuestions to the lab printer.
Firefox is an open-source web browser that looks and acts much like Netscape or Internet Explorer. Open Firefox by clicking on the globe icon on the panel. First, if the Roanoke College page did not come up as the default page (probably the Ubuntu home page showed up), change the settings as follows. Select Edit from the menubar, and then click Preferences. The preferences window will open, and on the right you should see a textbox for Home Page. Type in www.roanoke.edu and click OK. Clicking the Home button in the main browser window should now take you to the Roanoke home page. Now type the following URL (be sure to use the right one for your class) into the Location box:
http://cs.roanoke.edu/Fall2005/CPSC120A (Dr. Hughes' class) or http://cs.roanoke.edu/Fall2005/CPSC120B (Dr. Ingram's class)
Look over the page; note that it contains links to the syllabus, to various useful information, and to the programs (none yet) and labs. Click on the lab 0 link and you'll see the online version of this document. Most labs will contain links that you need to follow, so in general you will use the online version.
Now go to myrc (http://myrc.roanoke.edu), log in, and go to the Outlook tab. Click on the new button in the upper-left hand corner, and address the message to your instructor (firstname.lastname@example.org or email@example.com). Put UnixQuestions in the Subject line. Click Attachments, then Browse, and find your UnixQuestions file -- this is a graphical view of the file system, so double-click the folders to open them. When your have located the file, click Open and then Attach. The filename should now be under Current file attachments. To return to the message composition screen, click Go Back to Message. You should see your filename next to Attachments. Now, send the e-mail. After each lab you will e-mail your work to your instructor.
Close Emacs and Mozilla.
Exiting an X-terminal: To exit an xterm, type exit at the command prompt.
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.)