CS160: Foundations in Programming: Spring 2015
Recitation R1 - Linux Operating System
The goals of this lab are as follows:
- Review and finish last recitation
- Introduce Linux commands (in a terminal window)
- Present the Linux file system
- Manipulate text files in Linux
Review last recitation
Your TA will cover anything from the last recitation that was missed. You
should know how to do the following:
- How to find and launch applications on Linux.
- How to run a terminal, browser, file manager, and Eclipse.
- How to change your password.
- How to setup Eclipse to automatically create comment headers.
- 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:
Manipulating Text Files
Perform the following actions:
- Use gedit to create the Name.txt: gedit Name.txt &
- The file should contain one line which has your first and last name.
- Save the file.
- Copy Name.txt to another file called Name.bak.
- Compare the contents of the two files using the diff command.
Are they the same?
- Open Name.bak as a second tab in gedit.
- Add a second line to Name.bak with your student ID.
- Compare the two files again. Are they the same?
- Remove Name.txt.
- Move Name.bak to Name.txt.
- 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.
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.