CS21 Lab0: UNIX and vim

Due 11:59pm Tuesday night, September 2

This lab assignment should get you used to running update21 and handin21.

1. Read the class web pages

Start by reading through all of the CS21 homepage. Pay special attention to the Schedule, Academic Integrity and How to succeed in CS21 parts. You should get into the habit of checking this page weekly; the class schedule, homework assignments, weekly readings, and announcements will be posted to the class Schedule weekly.

2. Read the CS web pages

Go to the CS homepage (http://www.cs.swarthmore.edu/). From there click on the "Help" button and read the Welcome Message, The User Agreement, and The CS Lab Rules pages.

3. Learn some UNIX

If you don't have one already, create a cs21 subdirectory in your home directory and set the permissions so that only you can access it. Here is an example of commands to enter to do this and to verify that it worked ('$' is the shell prompt and text after '#' are comments explaining the commands):

  $  cd                 # change to your home directory 
  $  pwd                # print current working directory
  $  mkdir cs21         # create a new subdirectory named cs21
  $  ls                 # list contents of current directory
  $  chmod 700 cs21     # make cs21 dir only accessible to you
  $  ls -l              # list permissions (cs21 should be drwx------)
  $  cd cs21            # change to cs21 directory
  $  pwd                # print current working directory 
Here is some information about the Unix directory structure.

4. Learn the editor...vim

In your cs21 directory run the vim tutorial to learn how to edit files in Unix. This tutorial says it will take about 25-30 minutes, but our students say it's more like 60 minutes.

  $  vimtutor           # start the vim tutorial


5. Run update21 and create bio.txt

Once you have learned how to use a Unix editor program, run update21 to get the starting directory for homework 0, then cd into that directory:

$ update21             # creates subdirectory 00 in your cs21/labs directory
$ cd                   # cd into your home directory
$ cd cs21/labs/00      # cd into the directory for lab 00
$ pwd                  # check to see that you are in the correct directory
                       # if you are, pwd should list: /home/your_user_name/cs21/labs/00
The program handin21 will only submit files in this labs/00 directory.

Next, start up vim (or vi) and open a new file named bio.txt and answer these questions:

  1. Tell me about some of your strengths. What are some things that you are good at doing (they don't have to have anything to do with CS)?
  2. Tell me a bit about why are you taking CS21.
  3. Tell me about any prior CS experience you have.

To start editing the file:

$ vim bio.txt

After you are done editing your bio.txt file, save your changes, exit vim (:wq in escape mode), and enter the ls command to list the file bio.txt. You can also run the cat command on the file to list it's contents to the terminal window:

$ cat bio.txt


Submit

Once you are satisfied with your bio.txt file, hand it in by typing handin21 at the unix prompt. You may run handin21 as many times as you like, and only the most recent submission will be recorded. This is useful if you realize after handing in some programs that you'd like to make a few more changes to them.

Using UNIX

Don't forget to attend a Using UNIX session. You can attend either session:
  Tuesday 8pm, 240 Science Center
  Wednesday 7pm, 240 Science Center