Intro to Unix

Due Date:

Wednesday, September 12th, 2007.

Introduction:

Before we get into programming proper, we need a few fundamental survival skills which we will use to control our environment. Since this will be a mostly paperless classroom, you will need to be able to do two things before we can do anything else:

  1. Find your way around the UNIX Operating System.
  2. Create and edit files with the vi text editor.

Let's begin with the first of those goals.

Description:

We will begin class today with a discusion of file systems. We will talk about what a file system is and look briefly at the Unix file system. After that, we will hava a web activity exploring basic unix commands we will need to manage our computing environment in Computer Science.

Activities

  1. At the unix command prompt ( $ ), type: links2. links2 is a text based web browser (we also have the older lynx browser installed on the system). Your screen will go blank. Now press the g key. This is where you can enter a web address. Pressing q will offer you the option to quit. There are two keys which will bring up a menu at the top of the screen. To find these, run: man links2 at the command prompt and read through the man page (man is short for manual).

  2. Using the web resources listed at the bottom of this page (and any other resources you would like to use), write out a description and an example for each of the Unix commands in the list that follows:

  3. In your home directory (/home/username), create a directory named computer_science, then change to this directory (pwd should return /home/your_username/computer_science when you are finished). Create the following subdirectories in the computer_science directory: programs, notes, and projects. Running pwd now you should see this:
         /home/username/computer_science
      
    and running ls should give you this:
        notes  programs  projects
      
    In the programs directory, create four more subdirectories named gvr, python, java, and c.

  4. The next skill you will need to master is to use a text editor. The editor we will use in this class is called vim. To learn to use vim, type the following at the unix prompt:
      $ vimtutor
      
    Follow along with this tutorial, trying out all the activities which it provides.

  5. A common task on a Unix system is compiling and installing software. For your last activity, you will install and run a useful tool for displaying the structure and contents of your file system. Since most software on a GNU/Linux system is free software, it is often the case that source code is downloaded directly, compiled, and installed. In this activity we will do just that.

Congratulations! You have just completed our introduction to Unix.

Evaluation

The evaluation for this lesson will consist of a performance exercise. You will select at random (I'll tell you in class about how the selection process will work) a task to be performed. Tasks will look something like this:

  1. Create a directory named sports in your home directory.

  2. Create subdirectories in the sports directory named baseball, football, basketball, and soccer.

  3. Create a file named stars.txt in the baseball directory. Add the names of three baseball stars, one per line, to this file. If you don't know the names of any baseball stars, just make up three names.

  4. Repeat the previous step in each of the other subdirectories of the sports directory.

The complete list of tasks can be found here.

Web Resources:



Valid XHTML 1.1!
  Valid CSS!