Colorado State University

CS160: Foundations in Programming: Spring 2015


Recitation R1 - Linux Operating System


The goals of this lab are as follows:

Review last recitation

Your TA will cover anything from the last recitation that was missed. You should know how to do the following:
  1. How to find and launch applications on Linux.
  2. How to run a terminal, browser, file manager, and Eclipse.
  3. How to change your password.
  4. How to setup Eclipse to automatically create comment headers.
  5. How to use the Checkin user interface to submit P1.

Useful Terminal Commands

Your TA will show you how to use the "man" command. For each of the following, figure out what action is performed and try the command. Be careful with the remove command!

man - read a manual page
pwd - print working directory
ls - list working directory
cd - change working directory
cp - copy file(s)
mv - move or rename file(s)
rm - remove file(s)
cat - list file(s)
less - list file(s)
diff - compare files


Your TA will talk about launching programs from a terminal using the ampersand (&), and 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 with the tab key works.


Linux File System

Your GTA will describe the hierarchical file system used in Linux. Make sure you know what each of the following identify:
~
.
..
/
current directory
home directory
file extensions


Manipulating 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 has your first and last 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 student ID.
  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 student ID present?

Check P1 Assignment

Show your preliminary test results on P1 to the instructor and helper so that we can be sure that all students know how to submit programs and look at their grades.

Getting Credit

Please get your name checked off on the roster sheet and submit Name.txt to the dropbox on RamCT to get credit for this lab.
© 2015 CS160 Colorado State University. All Rights Reserved.