CS253 Lab 1: Running Commands
Due Monday, August 26
For lab 1, you must log into isoptera (if you don't have an account on isoptera, let me know and I will make you one). Once on isoptera, create a directory called "cs253" in your home directory, and a file called "lab1". Enter the answers to the following questions into the file. You may want to open up a second shell on isoptera so you can find the answers while your text file is open. To do this, launch putty again if you're using Windows, or open another terminal if you're using OSX or Linux.
Create the text file like this (feel free to use a different text editor if you like):
nano lab1
Once nano is running, look at the lowest two lines on the screen to see how to operate it. The caret (^) means control, the key below shift on most keyboards. Hold down control and press the indicated letter. "write" is the same as "save". The filename will be the one you specified when you opened nano (lab1).
Here are the questions for lab 1:
- What is a Linux distribution? Why would you need to install a distribution instead of only the Linux kernel?
- How long has isoptera been running since it was last rebooted? Use the "uptime" command to find this.
- How many shells am I running on isoptera? Run "who", and count the entries for user seth.
- What happens if you run the command "ssh isoptera" on isoptera? (hint: Notice what happens if you exit the sesson after doing this)
- I have hidden a secret in the directory /tmp, in a file called "secret". What is the secret? You can use the "cat" command to print out the file, or open it in a text editor (nano, etc).
After the file is created, protect it so that other students can't read your answers. Do this by running the following command:
chmod 600 lab1
"600" refers to the permissions granted. 6 is read and write. 0 is no permission at all. The 6 is for you, the 0 in the end is for other users in your group, and the last 0 is for everyone else. I will use the administrator account to grade your lab. Permissions will be covered in detail later in the class.
Check and make sure your file is saved and named correctly by running this command:
cat ~/cs253/lab1
If your file is in the right spot, it should print out. The tilde (~) is a placeholder for your home directory. The shell understands it, so you can run the command exactly as it's written above. Remember, names on unix are case-sensitive, so if you called your file Lab1, it will not work. It's important to remember this principle when writing software intended to run on Linux, BSD, Unix varients, etc.
This assignment is worth 35 points, 5 from correct naming, 5 from correct permissions, and 5 from each of the questions above. Note on naming: I will be grading these via a script which will look for the exact name, so your lab must be in the correct location with the correct name. This includes case (upper vs. lower).