Second Summer 2009


Unix tutorial.
In this tutorial you will create an archive and place it somewhere for public access.

As you take the steps outlined below try to determine their meaning, for each step.

  1. Log into your silo account.

  2. Type pwd at the prompt.

  3. Type man pwd at the prompt.

  4. Type cd and press Enter. Where are you now?

  5. Type mkdir tutorial or mkdir ~/tutorial then press Enter.
    These two commands should amount to the same thing. Why?

  6. Move into the new tutorial folder.
    One way would be: cd ~/tutorial but other ways are possible.

  7. Make an experiments folder in it.
    Perhaps like this: mkdir experiments

  8. Move into experiments then check that you're in it.
    Perhaps: cd ~/tutorial/experiments; pwd then press Enter.

  9. In experiments create two folders: programs and documents.
    Here's how I can create one of them:
    mkdir ~/tutorial/experiments/programs

    Here's how I can create the other one:
    mkdir documents

    For both to work what assumption must be true? How are these two commands different?

  10. Move into programs and create two folders in there.
    Name one of the folders Java and the other one perl.

  11. Go into the perl directory and create a file with the following contents:
    #!/usr/bin/perl
    
    print "Howdy, I'm a perl program!\n"; 
    You should use cd to move into the folder.
    You should use pico or the text editor of your choice to edit the file.
    Name the file one and make it executable:
    chmod 700 one
    Run the program with ./one (notice the dot, indicating the current folder).

  12. Go into the Java folder and create a file with this contents:

    class One {
      public static void main(String[] args) {
        System.out.println("Hello, I am a Java program!"); 
      } 
    } 
  13. Name this file One.java and compile it with:
    javac One.java
  14. Use ls or ls -ld * to confirm that a One.class file gets created.

  15. Type man ls just for fun.

  16. Type java One to run the Java program created earlier.

  17. Notice the differences between developing and running a Perl program vs. a Java program.

  18. Go into the documents folder and create two files:

    pico doc1.txt
    pico doc2.txt
  19. In the first file please write your name, mostly.
    In the second write about something you like (or dislike). Or about something else.

  20. Now you're done creating the files for this tutorial.
    Go to ~/tutorial (using cd) to start creating the archive.

  21. We will now create an archive out of all your files.
    Before that type: du -a ~/tutorial and think about the output.
    What does du do? What does it stand for? Type man du if you're not entirely sure.

  22. Now position yourself in tutorial and issue the command to create the archive.
    Possible commands: cd ~/tutorial; tar cvf whoa.tar experiments

  23. Verify that you have a ~/public folder. Create it if necessary.
    If you need to create it: mkdir ~/public

  24. Verify that the archive has been created.
    Use ls as follows: ls -ld ~/tutorial/*

  25. Move the archive from tutorial to public using the Unix copy (cp) command
    For example: cp ~/tutorial/whoa.tar ~/public

  26. Compress the archive: gzip ~/public/whoa.tar

  27. You now need to make the archive available to everybody:
    chmod 644 ~/public/whoa.tar.gz
  28. You also need the public folder to be available to everybody:
    chmod 755 ~/public
  29. Furthermore the folder where public is needs to allow careful access to it:
    chmod 711 ~
  30. At this stage I can use a program to automatically access and check your archives:

    The program I will use can be found in /l/www/classes/a348/sum2006/software/alpha

Here's an exhaustive list of usernames I am going to be testing:


Talgat

Dean

Echo

Francis

Joe

Jordan

Alex

Dan

Logan

Leo

Madhuvanthi

Margaret

Neethu

Nick

Vikas

Rajeswari

Sarah

Sushmitha

Yoon Mo

Mohammed

Hongliu

Nathan

These are all the usernames we need to worry about for the time being.

If you don't see yourself above please let me know so I can add you to this list.


Updated by Adrian German for A202/A598