Colorado State University

Recitation R1 - Linux
Fall 2013

CS160: Foundations in Programming


The purpose of this lab is to learn the basics:

Logging In

  1. Login to the machine, using your eID (Same username that you use for RamCT)
  2. The initial password should be your student ID (that 9 digit number on your RamCard)
    Troubleshooting:
You will change you password later in the recitation.

Class WebSite and RamCT

  1. Start your preferred internet browser and type in the url www.cs.colostate.edu/~cs160.
  2. Look at the syllabus and progress pages.
  3. Find the recitation instructions for today.
  4. Open another tab and type in the url ramct.colostate.edu.
  5. Login on RamCT using your eID and password and make sure you can see CS160.

Linux hierarchy

Your GTA will describe the hierarchical file system used in Linux. Write down what each of the following identify:
~
.
..
/
current working directory
home directory
file extensions


Launching Applications

  1. Your TA will show you how to launch applications and add them to the task bar.
  2. Click on "Activities" in the upper left corner of the screen
  3. Click on "Applications"
  4. Run File Manager, Gedit, and Terminal.

    This should bring up a terminal window where you can type in commands, similar to using DOS command prompt on Windows.
* Alternatively, you can use alt-F2 to bring up a command window where you can type terminal.

Useful Terminal Commands

Your TA will show you how to use the "man" command. For each of the following, write down what action is performed.

man
pwd, ls, cd
cp, mv, rm
mkdir, rmdir
cat, diff, less
>>, |
Opening other programs: &

Your TA will show you how to look at the history of commands, how to recall previous commands, and how to search the history buffer, and how to edit recalled commands. In addition, you will learn how auto completion works.

Use the passwd command to change your password. It is recommended that you change it to your RamCT password.

Text Files

Perform the following actions:
  1. Use gedit to create the Name.txt: gedit Name.txt &
  2. The file should contain one line which is your name.
  3. Save the file.
  4. Copy Name.txt to another file called Name.bak
  5. Compare the contents of the two files using the diff command. Are they the same?
  6. Open Name.bak as a second tab in gedit
  7. Add a second line to Name.bak with your EID.
  8. Compare the two files again. Are they the same?
  9. Remove Name.txt.
  10. Move Name.bak to Name.txt.
  11. Cat the contents of Name.txt. Is your login present?
  12. Append the contents of the pwd command to Name.txt.
Show the output to your TA before moving on.


Submitting Recitation Work on RamCT

Your TA will guide you through finding your program in the file system for submitting to RamCT:
  1. Go to RamCT by typing in ramct.colostate.edu or through the course website.
  2. Find Recitations on the left side.
  3. Submit the the Name.txt file you wrote today for the R1 recitation.

Logout of your terminal when you have completed this exercise.
Click on "your name" in the top right corner of the screen and select "Log Out".

© 2013 CS160 Colorado State University. All Rights Reserved.