UNIX BASICS

CS 3000 -- Lab Assignment #1 (For Unix Beginners)

Read this material. Do the exercises here that you don't understand completely. Work with a partner

  1. Password Check:
    a. login to one of the Sun Ultra's

    b. If you don't have an appropriate password, change it. (On Suns, use nispasswd.)

    c. If you changed your password, log out and then log back in to make sure your new password works the way you think it should.


  2. Do a man ls, read the DESCRIPTION section, and look at some of the options such as -l, -a, -F, and -C

  3. File Copy Exercise:
    a. Do ls ~john. This lists the contents of my home directory. Remember that the tilde (~) is a special symbol that means "home directory of." If you know a person's user name, you can use this notation to access his or her home directory, even though you may not know the path to the directory.

    b. Do ls -l ~john

    (That's an "el up there after the hyphen," not a "one.") Look at the information that is written when you run the command. Ask someone what it means or go back and do man on ls again. Next, find a directory inside ~john with permisions that allow you to cd to it.

    c. Do a cd to the directory you found in part b.

    d. Look around and see what is there (if you get stuck ask for help)

    e. Look for an ascii file. If you don't find one where you are, try moving into a different sub-directory of ~john.

    f. Do cp filename ~/ where "filename" means the name of the ascii file you found. This command copies the file into your home directory.

    g. Do cd ~ or just cd (This puts you back into your home directory)


  4. Making a Directory and Moving a File:
    a. Do an ls on your home directory

    b. Do an ls -al on your home directory

    c. Do mkdir CS3000

    d. Do another ls -al and look at the permissions on the directory you just created

    e. Move the file you copied in step 3f into the new CS3000 directory using the mv command

    f. Repeat steps 3 & 4 for a different file except don't make a new directory this time.


  5. Reading a File:
    a. Take a look at a file using more. (Do more filename).

    b. Take a look at a file using less

    c. Take a look at a file using cat

    d. Take a look at a file using cat, piping the file through more


  6. Using the rm Command
    a. Do a man on the rm command. Read the DESCRIPTION section and several of the descriptions of options.

    b. Remove one of the files you made in step 3f.


  7. Using the pwd Command
    a. Do a pwd (this tells you the current working directory)

    b. Do a cd to your home directory

    c. Do a pwd again

    d. Remove the other file you copied in step 3f, unless you want to hold on to it for a while.