Classwork 1: Booting Linux

Objectives

The first encounter with Linux

Assignment 1: submit something

  1. Boot into Linux (see posted instructions). Log in with your usual UMBC username and password.

  2. Use cat > joke.txt to store your best (clean) joke or personal motto in a text file. (Type Ctrl-D to end your input.)

  3. Use cat joke.txt to check that your joke or motto was correctly saved.

  4. Have neighbor check if joke is funny. If not, rm filename and try another joke or motto.

  5. Submit using:
       submit cs104_chang cw01 joke.txt
    

  6. Check your submission with:
       submitls cs104_chang cw01
    

Assignment 2: exploring unix commands

Commands you will use: pwd, ls, mkdir, cd, cat, more, less, rm, rmdir, mv, man

Follow the steps below in order. Notice that you are not always given the full command to use. As you move through the exercise, you are given fewer and fewer commands. It's time to think! Use your class notes as a reference.

Creating a Directory Hierarchy (Tree) To Use During the Semester

  1. Log into your gl account.

  2. Look at the name of your home directory.

    linux1[2]% pwd
    /afs/umbc.edu/users/p/a/park/home   
    linux1[3]%    
    
    

  3. Look at the contents of your home directory. It might contain the following (and possibly more or less) files and subdirectories:

    linux1[4]% ls
    Mail  bin  www  joke.txt
    linux1[5]%
    
    

  4. Look at the "long" contents of your home directory. You should see the same subdirectories, but with more information about each.

    linux1[6]% ls -l
    total 6
    drwx------    2 park rpc  2048 Sep 15 09:04 Mail
    drwx------    2 park rpc  2048 Sep 15 09:04 bin
    -rwx------    1 park rpc  1024 Sep 15 09:04 joke.txt
    lrwxr-xr-x    1 park rpc  2048 Sep 15 09:04 www -> ../pub/www
    linux1[7]%
    
    

  5. Look at the "hidden files in your directory using ls -a.

  6. Create a subdirectory called cs104. Verify that it has been created by again looking at the contents of your home directory.

    linux1[8]% mkdir cs104
    linux1[9]% ls
    cs104  Mail  bin  www  joke.txt
    linux1[10]% 
    
    

  7. Move to the cs104 directory. Verify that your current directory is now indeed cs104 (Remember that linux is case sensitive...so cs104 is different from CS104.)

    linux1[11]% cd cs104
    linux1[12]% pwd
    /afs/umbc.edu/users/p/a/park/home/cs104
    linux1[13]%    
    
    

  8. Create 3 new subdirectories, for the first 3 homework assignments that you will be doing in this class. Call them hw01, hw02 and hw03. Verify that each of the subdirectories has been created.

  9. Move the joke.txt file you created in your home directory to the hw01 directory. Check to see that it is no longer in your home directory. Then, check to see that it is in the hw01 directory. You should be in the cs104 directory when you issue these commands.

    linux1[14]% pwd
    /afs/umbc.edu/users/p/a/park/home/cs104   
    linux1[15]% mv ../joke.txt hw01/
    linux1[16]% ls ..
    cs104  Mail  bin  www
    linux1[17]% ls hw01
    joke.txt
    linux1[18]%
    
    

  10. Change directory to the hw01 directory. Rename your joke.txt file to joke2.txt :

    linux1[18]% cd hw01
    linux1[19]% mv joke.txt joke2.txt
    linux1[20]%
    

  11. Use nano joke2.txt to edit your joke2.txt file and add the following joke to the end of the file:

    Why do ducks have webbed feet?
    To stamp out fires.
    
    Why do elephants have flat feet?
    To stamp out flaming ducks!
    

  12. Submit your new joke2.txt file:

    linux1[20]% submit cs104_chang cw01 joke2.txt
    

  13. Log out.