(Updated: 2007/01/15)
CPSC 101 Lab: Getting Started
Last updated by: Michael Chiang (mchc at cs dot ubc dot ca)
Comments to: Steve Wolfman (wolf at cs dot ubc dot ca)
Sources and contributions: Some of the lab materials were taken from the CPSC 100-101 lab manual. The first version of this lab was created by Shelly Zhao. Revisions were made by Tanya Ellchuk, Holger Hoos and Steve Wolfman.
The purpose of this lab session is to acquaint you with
basic things you should know to do when using a computer to create documents or explore
the web. You will learn how to interact with different elements of the
Graphical User Interface (GUI). These include icons, windows, menus, files,
folders, documents, and applications. The main activity of the lab will be to
create a simple document about you and your interests.
The lab covers the following topics: Read through all of the lab instructions prior to your lab
session. Fully understand the lab etiquette described below. Chapters
2 and 3 of the textbook provide useful background. Things you should do: Things
you shouldn't do:
Long sessions with the computer can cause you physical discomfort or even harm if you're not careful. Learn how to take care of yourself by reading up on how to get comfortable while using the computer (also known as ergonomics).
Contents
Objectives
Before the Lab
Lab Etiquette
You will not hurt or damage the equipment through normal use.
Getting Comfortable
During the Lab
Start the Computer
Before you begin work, you may need to swtich the computer on. As each lab computer is shared by all account holders, you must first log in. If you already have an account, enter your username and password in the login dialog box. Keep your password a secret!
If you don't have an account yet, the following section will show you how to set one up.
In the initial menu, choose any one of the UNIX machines (those marked with an "X" on the left hand side) by double clicking on its name. As you don't yet have a login id, at the log in prompt, type getacct. Follow the instructions on screen. You will be prompted to enter your student number and last name and will then be asked to create a password. The password should be 8 characters long. Once this process is complete, you can log out, and use the username and password you have just created to log into the Windows environment, as opposed to UNIX as done before. (Making a good password can be challenging! Check out the References section for more information on passwords.)
IMPORTANT: The login ID assigned to you by 'getacct' then forms your UBC computer science email address, please make note of this. For example, if your login ID is "r2d2", then your new email address is "r2d2@ugrad.cs.ubc.ca", without the quotation marks. Remember this ID, and keep you password safe! You will need both of these everytime you log in.
To log out of your account when you are finished, click the start button at the bottom-left of your screen and choose shutdown then log off in the next dialog. A more visual description is available here.
A file is a collection of bytes stored as an individual entity. All data on disk is stored as a file with an assigned file name that is unique within the folder (directory) it resides in. Different types of files are used for different purposes. A text file is a file that contains only characters meant for displaying and formatting text. In this lab we will create a simple text file using Notepad.
Open Notepad:
click
,
,
, ![]()
Type the following information about yourself into the document:
After finishing all the input, click File from the menu bar, choose Save or Save as,
Next choose disk/drive Z in the Save in box,
and click on the Create New Folder Icon
, type lab0 and press enter.
There should be a folder called "lab0" now. Double click on this folder to open it and type lab0.txt as your File name. Then click Save.
Close the file by choosing File -> Exit, if it asks "Do you want to save the change?" Click Yes.
Find the "My Computer" icon on the desktop. Double click on My Computer, find Disk Z, make sure there is a folder "lab0" that has a file lab0.txt in it. If not, you need to create the file again.
IMPORTANT: Please note Disk Z represents the storage space you are allocated with the creation of your computer science account. Aside from what you place in this space, administrative files will also exist (which you should not remove/alter).
In a graphical user interface (GUI), a folder holds data, applications and other folders. Folders were introduced on the Xerox Star, then popularized on the Macintosh and later adapted to Windows and UNIX. In Unix, DOS and Windows 3.1 (an old Windows), a folder is known as a directory, and a subfolder (folder within a folder) is a subdirectory. (Folders aren't the only metaphor for arranging information, however! Check out the References section for more information on Flickr and tagging.)
Windows Folders:
Folders on the hard disk are pictured as manila file folders, but they are not
fixed in size and can hold as much data as there is room on the entire disk.
You can use My Computer in future labs when you will need to create folders (directories). As described above, double click the My Computer icon, double click Disk Z. All file and folders that belong to your home directory will be displayed. To select a directory to see its contents, double click on it. To create a new directory, click on the File menu, select New, then select Folder and give your new folder a name. To rename an existing folder, select it (by clicking on it once). Once selected, you can do one of the following:
click on File and select Rename
press the right mouse button and select Rename from the shortcut menu that pops up
press the F2 key
and enter the new name for your folder. You can also use Windows Explorer to view, rename, or delete your files, as well as create new ones. To open Windows Explorer click Start -- Programs -- Accessories -- Windows Explorer.
Open a new file:
Tip: To open a document you've used recently, click History on the Places Bar in the Open dialog box.
Now, open the file lab0.txt you just created, and add more content by answering each of the questions listed below. Each question will need to be started with a separate paragraph. Press the "Enter" key at the end of each paragraph. Don't worry about the format of the file; we will take care of it in later labs. Remember to save the file after finishing each paragraph. See the next section for how to save a document as you work.
Answer the following to add content to your lab0.txt file:
How do you expect
to use computers in your life and career?
How do you most often use computers now?
What do you most want to learn from this course?
What computer skills are you most interested in learning about?

Get some practice doing that now by saving a picture from the undergraduate web site:
When you open or save a file, you can locate a folder in the following ways.
| To | Do this |
|---|---|
| Go to any location available from your computer | Click a drive, folder, or Internet location in the Look in box (Open or Insert dialog box) or Save in drop-down list box (Save As dialog box). |
| Create a new folder | Click Create New Folder . |
| Open a folder in the folder list | Double-click the folder. |
To close a file, choose File on your application's menu bar, and choose close in the pop-up menu. Ctrl-F4 has the same function in most applications.
To close an application, choose File on your application's menu bar, and choose Exit in the pop-up menu. Alt-F4 has the same function in most applications.
In some applications, there may not be a close, you can always choose Exit after you save.
You can also click the
icon on the top right of your window to close an application or a window.
Several web browsers are available on this system, including Mozilla/Firefox, Netscape, or Internet Explorer (IE). The following steps are written for Mozilla/Firefox, but are applicable to other browsers. For the purposes of this lab, choose Firefox (located on 'desktop').
If you want to save the location of a favorite page or if you want to visit certain pages often, you'll want to create bookmarks for those pages. Bookmarks are saved on the Bookmark list until you decide to delete them. (Bookmarks are a big deal in web browsing; check out the References section for more information about collaborative bookmarking!)
Bookmarks and bookmark folders are arranged like folders and files on your hard drive. The easiest way to access bookmarks is by using the Bookmarks menu.

Now go to the page http://www.cs.ubc.ca/ugrad
. Hold down the Bookmarks button
on the location
toolbar and select "Add Bookmark" (or "Bookmark This Page" or a similar phrase) to add a bookmark for the current page to the
bottom of the Bookmarks menu. Or press Ctrl+D to add a bookmark instantly.
Open the Bookmarks menu and you'll see your bookmark filed at the bottom of the
list.
You can learn how to set up Thunderbird to read e-mail by clicking here. Try sending an email to one of your personal email accounts! If you are familiar with Outlook Express, you can use that instead. Try sending an email to one of your personal email accounts!
We won't learn Unix in this course, however, we may need to use some of its features through our labs. If you are out of time to do this in the first lab, don't worry - you know where to find the information when you need it. Here is what you need to do.
When you first open SecureCRT you will most likely see the following:

If you see

instead, pressing the right mouse button on the word Sessions and selecting Quick Connect from the shortcut menu that pops up should give you the following

Changing the protocol to ssh2 will change the window to reflect the first Quick Connect window shown.
Alternatively, you can select Quick Connect from the File menu to get the windows described above.
Once you have a Quick Connect window open, change the Protocol to ssh2; the content of the window should change. Complete the fields to reflect this sample below:

Press OK when you are finished. Make sure that you save this session; otherwise you will have to go through this process each time you open SecureCRT.
You will need to provide your username and password again to login to the server. They are the same ones you use to login to the PC.
Type the following at the xterm window:
ls -l
then the following information might be displayed:
-rw-r--r--
4 a1a1 guest 9512 May 10 15:21 banner.gif
drwx------
1 a1a1 guest 512 May 13 09:59 document
-rwx------
1 a1a1 guest 5275326 May 27 15:53 emacs
-rw-------
5 a1a1 guest 11512 May 28
15:28 hello.cpp
-rw-r--r--
4 a1a1 guest 512 May 19 15:27 homepage.html
drwx------
1 a1a1 guest 25194 Jun 16 09:59 temp
If you want to learn more about what the output means, try typing ls --help or man ls. The man command (short for "instruction manual") can also give you help on other commands. Try man for more information!
NOTE: "ls" is an important and often-used command. For example, whenever you have modified the contents of a directory (e.g. added a new file), and want to confirm that the modifications were done correctly, the "ls" command can help you check this.
The Command "mkdir"
As you start a new project, you might need to create a new directory for storing files. To make a new directory, use the make directory command, mkdir. The directory will be created as a subdirectory of the current working directory. If you want to create the directory "cs101" inside your home directory, then while you are in your home directory, you should type:
mkdir cs101
Unix makes a new directory named "cs101", located in your home directory.
The Command "rmdir"
To remove a directory, you use the remove directory command, rmdir. The command name is followed by the name of the target directory. For example,
rmdir ~/cs101
will remove the "cs101" directory located in the home directory. If the target directory contains files or subdirectories, rmdir will display the error message:
Directory not empty
Sometimes rmdir will report a more cryptic error, such as:
rmdir: cs101: File exists
You must delete all the files and subdirectories in the target directory before removing the directory.
Unix allows you to copy, move, rename, and remove files. You can make a copy of a document before experimenting with format changes. You can move files into or out of a directory, and rename files to better organize them. When a file is no longer needed, you can remove it.
To duplicate a file, use the copy command, cp. The format of the command is:
cp source_filename destination_filename
where source_filename is the name of the original file and destination_filename is the name of the resulting copy.
Moving (or Renaming) Files
To move a file to a different location, use the move command, mv. The format of the command is:
mv source_filename destination_filename
where source_filename is the name of the original file and destination_filename is the name of the file to move to.
To remove a file, use the remove command rm. This command has the following form:
rm filename
where filename is the name of a file you want to remove.
Note: rm is very powerful and permanent; use it with extreme caution. It is difficult and sometimes impossible to recover a removed file in a Unix system!
Click here for a summary of basic UNIX commands.
Ergonomics is the study of the relationship between people and their work with the goal of designing job tasks, work stations, tools and equipment to fit the physical capabilities of people. Creating a good ergonomic working arrangement is important to protecting your health. Following is a useful link for information on computer ergonomics:
Cornell University Ergonomics Web: http://ergo.human.cornell.edu/ergoguide.html