Lab 1: Computer Ergonomics and Using Linux
Objectives
to become aware of some ergonomic issues in using a computer
to become familiar with the Mandrake/KDE environment.
_ to learn how to create and traverse directory structures.
_ to use a text editor to create files.
A. Ergonomics
Making slight adjustments to our computer environment before working for prolonged periods can help prevent common computer-related injuries to the wrist, eye, and back. Here are a few tips* to assist in setting up your environment in ways that will help reduce stress on your body while using the computer.
What can you see? Make sure that any paper documents that you are reading are placed as close to the computer monitor as possible The computer monitor should be placed:
directly in front of you and facing you, not angled to the left or right. This helps to eliminate too much neck twisting. Also, whatever the user is working with, encourage him/her to use the screen scroll bars to ensure that what is being viewed most is in the center of the monitor rather than at the top or bottom of the screen.
put the monitor at a comfortable height that doesn't make the user tilt their head up to see it or bend their neck down to see it. Try to align your eyes with the top of the viewing area of the screen, and this should put the center about right geometrically. Sit back in your chair at an angle of around 100-110 degrees (i.e. slight recline) and hold your right arm out horizontally, your middle finger should almost touch the center of the screen. From that starting position you can then make minor changes to screen height and angle to suit. Research shows the center of the monitor should be about 17-18 degrees below horizontal for optimal viewing, and this is where it will be if you follow the simple arm extension/finger pointing tip.
Posture, posture posture! Good posture is the basis of good workstation ergonomics. Good posture is the best way to avoid a computer-related injury. To ensure good user posture:
Watch the user's posture!
Make sure that the user can reach the keyboard keys with their wrists as flat as possible (not bent up or down) and straight (not bent left or right).
Make sure that the user's elbow angle (the angle between the inner surface of the upper arm and the forearm) is at or greater than 90 degrees to avoid nerve compression at the elbow.
*These tips are taken from a website at Cornell University
( http://ergo.human.cornell.edu/ergoguide.html )
Make sure that the upper arm and elbow are as close to the body and as relaxed as possible for mouse use - avoid overreaching. Also make sure that the wrist is as straight as possible when the mouse is being used.
Make sure the user sits back in the chair and has good back support. Also check that the feet can be placed flat on the floor or on a footrest.
Make sure the head and neck are as straight as possible .
Make sure the posture feels relaxed for the user.
Keep it close!
Make sure that those things the user uses most frequently are placed closest to the user so that they can be conveniently and comfortably reached.
Make sure that the user is centered on the alphanumeric keyboard. Most modern keyboards are asymmetrical in design (the alphanumeric keyboard is to the left and a numeric keypad to the right). If the outer edges of the keyboard are used as landmarks for centering the keyboard and monitor, the users hands will be deviated because the alphanumeric keys will be to the left of the user's midline. Move the keyboard so that the center of the alphanumeric keys (the B key, is centered on the mid-line of the user).
make sure that the phone is also close to you if you frequently use it.
A good workstation ergonomic arrangement will allow any computer user to work in a neutral, relaxed, ideal typing posture,(see figure below), that will minimize the risk of developing any injury. An ideal keyboard arrangement is to place this on a height adjustable negative-tilt tray. An ideal mouse arrangement is for this to be on a flat surface that's 1-2" above the keyboard and moveable over the numeric keypad. If you want a surface at the level of the keyboard base then make sure that this can also be angled downwards slightly to help to keep your hands in wrist neutral while you are mousing, and keep your elbow is as close to the body as possible while you work.

B. Using the Linux Desktop
The screen setup you have on the Linux workstation is called KDE, which stands for the K Desktop environment. KDE is similar to other Graphical User Interfaces (GUIs) like Windows. The main KDE menu can be accessed by clicking the left-most icon on the task bar at the bottom of the screen, (a yellow star.) This is like the start button in Windows and it has many submenus allowing the user to configure the system as well as run various applications.
There are several other buttons/icons on the task bar, including a web browser, (red dinosaur icon), multiple Desktop indicators, (dark gray boxes with numbers), a window list icon, a clock and others. On the desktop (large window), you can see several other icons, including a trash can (like the Macintosh’s garbage can or Windows’ recycling bin), a link to your home directory, and a few others.
The terminal window
Much of your work will be done using a terminal window. This is a window from which you can issue commands to the Linux system. The window may have automatically appeared when you logged in. If it didn’t, you can always create a new terminal window by pressing the icon on the main panel that has a monitor on it, or by clicking on the K-menu(star), then the Systems submenu and then choosing Terminals and XTerm.
The terminal window has a prompt, which generally ends in a percent sign (and a will appear after the prompt. However, the command you type will not work until you press the Enter key, at which time the computer will execute your command. When you type a command after the prompt you are said to be entering a command on the command line.
Go to the terminal window and type ls, followed by the Enter key. This is how you tell Linux to show a list of files. For example, you will probably see something like the following:
...% ls
www-docs/
...%
In this example, the user (that is, you) typed “ls” followed by Enter, and Linux came back saying that you have one item, www-docs, in the current directory. (You may see a different list.)
If you have not already, you should type the following at the Linux prompt to set up files for the rest of this lab.
...% getcs 161 1 The third word is the lab number 1, not the letter l
After pressing Enter, type “ls” again (followed by Enter) to see what getcs changed. (It should have added a CS161 directory.)
Creating a file
For some labs, you will want to create and edit files. To do this, you can use the text editor called nedit. (A text editor is a program that allows you to edit text, sensibly enough. It’s a lot like a word processor, but with text editors you work directly with the exact letter-for-letter file, whereas word processors always include additional formatting information.)
To start nedit, click the nedit icon in the bar at the bottom of the screen. (The nedit icon is an uppercase “N” over a yellow diamond.) If you cannot find nedit on your bar, you can start it by clicking on the K menu, then CSBSJUMenu, Computer Science, and finally on Nedit.
This editor works a lot like what you may have experienced using editors or word processors in Windows or Macintosh systems. You can type whatever you want here, and it will go into the file after you save by clicking on the File menu and the Save entry. (Alternatively, you can hold the Control key while you type s and this will also save.)
One thing that is different in Linux is the method you can use to copy text from one window to another. To do this copying, first highlight the text you wish to copy. (You can highlight some text in a window by moving the cursor to the beginning of the text, pressing and holding the left mouse button, and, then, moving the mouse to the end of the text you wish to copy and releasing the button.) The text you wish to copy should now be highlighted. To copy it, move the cursor to the place where you want the copy of the text to go and click the middle mouse button. This should cause the text to be copied.
To try this, we will copy the contents of your directory into your lab notes. First be sure you have started nedit and that you have a terminal on the screen at the same time. Go to the terminal window and type “ls” again. Copy the block of text, including the ls command, the system response, and the prompt, to the nedit window by following the steps described in the previous paragraph.
Saving files
To save your work so far, click on the File menu at the top of the nedit window and select Save As. Type
in the filename you would like to use for this report at the right end of the box labeled New File Name. (We recommend using report1 for the name of the file.)
The letters preceding your filename in that box are the complete directory path which shows where the operating system will put your file. You will want to save your files fairly often to make sure that a power outage or machine failure does not destroy your work. You can use the Save option to save your work again under the same name. (You can also use Save As in the File menu if you wish to save a backup of a file under a different name.)
File and directory names in Linux generally consist of letters, digits, underline characters, and periods. Unlike some other operating systems, Linux distinguishes between uppercase and lowercase letters. (Linux filenames usually use all lowercase letters, but this isn’t required.) If you want a name consisting of several words, you can separate the words with periods or underline characters. DO NOT PUT SPACES IN YOUR FILE NAMES!
At this point, save your work in report1 again.
Directories
Like most modern operating systems, Linux systems arrange files hierarchically using directories. A directory is a special type of file that contains files. Of course a directory can contain directory files too. Directories are often called folders after the common icon used to represent them.
Linux uses slashes to indicate directory structure. For example, consider the directory
/usr/people/faculty/cs/jschnepf/CS161
This refers to the CS161 directory in the directory called jschnepf. The slashes separate directories in
higher and higher levels. Thus, CS161 is a directory inside directory jschnepf which is a directory inside directory cs which is a directory inside directory faculty, which is a directory in directory people, which is a directory in directory usr. The usr directory lies inside the root directory, which in Linux is represented by a single slash (/).
Every directory automatically contains two special directories. You generally won’t see these, but they are frequently useful. (You can see them if you type ls -a.)
The directory named . (that is, a single dot) refers to the directory where the system is currently working.
_ The directory named .. (that is, two periods together) refers to the directory above the current directory.
For example, if cs were the current directory in the example above, then .. is another name for the faculty directory that cs is in.
Another useful directory to know about is the ˜ directory, which is shorthand for your home directory. (For the user named jschnepf, the home directory is the directory called jschnepf above.)
Desktop file access
Your home directory is represented by an icon on your desktop, (picture of a house and the word “Home” below it) Double clicking that icon will open your “home” directory. You can also access the directory via the K-Menu(the yellow star), and then choosing “Home (Personal Files).”
You should now see the icons for the files in your directory. Among these icons should be a CS161 folder containing files for this lab assignment. To see the contents of this CS161 directory, double click on its folder icon. This will change the window to show the contents of the directory. (Alternatively, if you center-click the icon a new window will open showing the contents of the CS161 directory.)
Within the CS161 directory, you should find a Lab1 directory. (Note that there are NO spaces in Lab1. As mentioned above, Linux can have a great deal of trouble with spaces in file or directory names.) If you chose to look within the Lab1 directory, you would find within it yet another directory called Mammals. You will probably want to keep all your computer files for this course in your CS161 directory, just to be organized. As you use the computers more and more you will find that this organization is extremely useful. It helps you find files if you put them in directories with appropriate names.
If you wanted to create a new subdirectory called Lab0 in the CS161 directory, you would make certain you were in the CS161 window, then you would click on the Edit menu, then you would
click on the Create New submenu and click on Folder. This will prompt you for the name of the new directory, with default name “New Folder”. Type in “Lab0”, then click OK to create the directory Lab0.
You should now see the two directories Lab0 and Lab1. Now delete Lab0 by clicking the right mouse button on the folder labeled Lab0. You should see a new menu that has an entry called Delete. Click on Delete to remove the icon and the directory.
(Note for use in the future: if you double-click on a file’s icon, the computer should open the file in nedit. This can be easier than opening nedit and opening a file from inside the editor.)
You may want to close all the directory windows opened in this lab before going on. You can close a window by clicking the X button on the far right side of the title bar on the top of the window or by choosing close from the file menu.
If you want to access your Outlook account, you can go to the web address exchange.csbsju.edu
using Mozilla, which is available in the Internet submenu of the K-menu button, under Browsers and also on your menu bar as well, (the red dinosaur is the Mozilla icon.). You can use this to send and receive email and access directories in a manner similar to using Outlook on a Windows or Macintosh machine.
Send an email to the person on your right in your small cluster of machines. (If you are the rightmost person, send an email to the leftmost person in your cluster.) Read the email message.
C. The Linux command line
To become a proficient Linux user, it is useful to have a good understanding of the Linux command line — that is, you need to become proficient at manipulating files via the terminal window. In this section we’ll look at several of the most important Linux commands.
To start, make sure that you have a terminal window open. Everything you do in this section will be done from that window.
Here is a drawing of the directory hierarchy you will be using in this section.

As we have already seen, Linux files are arranged hierarchically. Your directory should already be set up
as in the picture above. This indicates that Mammals is a directory inside the Lab1 directory, while the
Mammals directory contains a Cats directory, a Dogs directory, and an Other directory. Each of these has its own contents.
Navigating directories
As you use the command line you have a working directory, which is where you are currently located in the directory structure. To see your working directory, you can type “pwd” at any time at the command prompt (and, of course, then pressing Enter). The pwd command will display where you are. (It stands for Print Working Directory.) If you type “pwd”, you should see something like:
...% pwd
/usr/people/faculty/cs/jschnepf
...%
You can move between directories using the cd command. (cd stands for Change Directory.) For
example, the CS161 directory should be in your current working directory (which should be your home
directory at this point). So you can type “cd CS161” to move into it. This changes your working directory to be your CS161 directory. If it’s successful, it won’t look like it does anything, but if you type “pwd” again, it should show your new working directory. (The cd command stands for Change Directory.) You will see something like the following.
...% cd CS161
...% pwd
/usr/people/faculty/cs/jschnepf/CS161
...%
If you were to type “cd CS161” again, it would fail, because our current directory (CS161) doesn’t contain a directory called CS161.
...% cd CS161
cd: No such file or directory
...%
However, the following would work.
...% cd Lab1/Mammals/Dogs
...% pwd
/usr/people/faculty/cs/jschnepf/CS161/Lab1/Mammals/Dogs
...%
In this example, we told the computer to change into the Dogs directory, which is located in the Mammals directory, which is located in the Lab1 directory in the current working directory.
To go to Lab1 from here, type “cd ../..” to move up two levels. Notice how we use the special hidden directory .., which always refer to the parent directory of the current directory.
Practice
For your reference, the table below summarizes all the Linux commands we will use in this lab assignment.
DO NOT execute the example instructions in the figure — some are irreversible. Just look through them
quickly before continuing.

To get a feel for Linux, try doing each of the following. You won’t need to include any of these steps in your lab report. As you go along, you might use the directory windows if you want to see how these commands work. In order to see the changes, however, you may need to hit the refresh button after doing the command. You should be using the command line for all actions. Use the GUI only if you wish to see the results in the file manager.
If at any time you do not see the files and directories you expected to see, stop and figure out where you have gone wrong. As you complete each command, you need to understand what it does. If you need help, ask a TA or professor.
1. Start by making sure you are in the Lab1 directory. (If you are not in the Lab1 directory, get there
by typing “cd ˜/CS161/Lab1”.
2. Check to see what files and directories are in the Lab1 directory (Use “ls”).
3. Create a subdirectory of Lab1 called Hal (“mkdir Hal”).
4. Check if Hal was created by displaying the files and directories in the Lab1 directory again (“ls”).
5. Change to the directory Mammals (“cd Mammals”).
6. Check to see if you are in the Mammals directory (“pwd”).
7. List the files and directories in Mammals (“ls”). One of the subdirectories should be Cats. Look
at the files in the Cats directory (“ls Cats”). You might open the Cats window through the file
manager and compare the results.
8. Change to the Cats directory (“cd Cats”) and display the contents of the file kittyCat (“cat
kittyCat”).
9. Also try the alternative, “more kittyCat”. The more comand displays a file a page at a time,
which is helpful when files are longer.
10. Change to the directory above your current location (“cd ..”).
11. List only the files whose names have the word cat in them in the Cats directory (“ls Cats/*cat*”). The ‘*’ character is a wildcard character which can stand for any sequence of 0 or more characters so *cat* represents a sequence of (0 or more) characters, followed by cat, followed by another sequence of characters (including the possibility of 0 characters).
12. Copy the 2cats file to the Hal directory. (“cp Cats/2cats ../Hal” copies 2cats in the
Cats subdirectory into the Hal directory that is in the parent directory of the working directory.)
13. Check if the copy was done by listing the filenames in Hal (“ls ../Hal”) or by examining your
home directory window.
14. Change the working directory back to Lab1 (“cd ..”). Type “pwd” to make sure you are in the
correct directory.
15. Create a new Puppy directory as a subdirectory of Hal (“mkdir Hal/Puppy”).
16. Copy all of the files from Dogs into the Puppy directory (“cp Mammals/Dogs/* Hal/Puppy”). (Note that * by itself matches with everything in the directory!)
17. Move the Puppy directory from Hal to the Mammals/Dogsdirectory (“mv Hal/Puppy Mammals/Dogs”).
D. Creating a directory structure
Now that you have had a chance to see some Linux commands in action, write your own commands to
build the following directory structure.

Lab1, Hal, and Mammals are pre-existing directories. The final contents of the Hal and Mammals directories are not important.
Critters and People are new directories to be created as shown in the figure above.
you and me should be copies of the files in the Mammals/Other/People directories.
Have the TA or instructor check your work.
1-