Recitation R1
- Linux
Fall 2013
CS160: Foundations in Programming
The purpose of this lab is to learn the basics:
- Log onto the CS machines
- Introduce you to the class website and RamCT
- Introduction to the Linux Operating System
- Linux commands and terminal windows
- Manipulating text files in Linux
- Submitting recitations via RamCT
Logging In
- Login to the machine, using your eID (Same username that you use for RamCT)
- The initial password should be your student ID (that 9 digit number on your RamCard)
Troubleshooting:
- Raise your hand if you cannot login!
You will change you password later in the recitation.
Class WebSite and RamCT
- Start your preferred internet browser and type in the url www.cs.colostate.edu/~cs160.
- Look at the syllabus and progress pages.
- Find the recitation instructions for today.
- Open another tab and type in the url ramct.colostate.edu.
- 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
- Your TA will show you how to launch applications and add them to the task bar.
- Click on "Activities" in the upper left corner of the screen
- Click on "Applications"
- 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:
- Use gedit to create the Name.txt:
gedit Name.txt &
- The file should contain one line which is your 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 EID.
- 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 login present?
- 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:
- Go to RamCT by typing in ramct.colostate.edu or through the course website.
- Find Recitations on the left side.
- 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.