Unix/HTML Survival Guide

R. Robinson
8/24/99, 1/19/01



Overview:
Unix is the operating system of most of the world's "serious" computing. It is what runs on all the University's large computers, and in particular, on gwis2. Unix is also beginning to become a serious alternative to Microsoft Windows for Intel chip based PCs  in the form of Linux.

In its plain form, Unix runs with a command-line interface (like DOS). This is the form of Unix we will use on gwis2 in Math 181. To get to the command line, log into gwis2 and choose option 9 on the gwis menu. This will give you the Unix prompt.

Note that most Unix workstatations (eg Sun workstations, SGI workstations and PCs running Linux) provide a graphical user interface called X-windows, which has a similar look to Microsoft Windows.



Editing Files:

Unix comes with an editor called "vi" that is a little tricky to use. Some people like it, and for certain advanced Unix tasks it is necessary to use it. However, it is not for beginners.

A popular choice for a Unix editor is the powerful  "emacs" which is a GNU product. It is not part of Unix, but is free. Unfortunately it has a steep learning curve. An excellent version for Microsoft Windows is now available.

Gwis2 is supplied with an easy flexible editor called "pico". Type "pico" form the command line to start it. After that it is fairly self-explainatory. (It is the editor built into the "pine").



Some very basic Unix commands:
 
  1. Type "ls" to list your files. In addition to file1 and file2 you should see files and directories that were set up with your account.
  2. To view an ASCII (text) file type "more",  eg "more file1" to see file1.
  3. To make a new file "file3" that has file1 a followed by file2, type "cat file1 file2 > file3" ("cat" is short for concatinate. ">"  redirects the output to the new file file3).
  4.  "mv file3 file4" will rename file3 to file4. "mv" is short for "move". It can also be used to actually move a file.
  5. First create a new directory by using the "mkdir" command: "mkdir new"
  6. Then "mv file4 new". Type "ls" to see it is really gone.
  7. Type "cd new" to go to the new directory and "ls" to see that the file is there.
  8. Type "pwd" (print working directory) to see what directory you are in.
  9. You can always type "cd" to return to your home directory.


Some very basic HTML:

In this exercise you will create a very simple web page from scratch.

To create a homepage:
 

  1. Log into gwis2 and choose 9 for a Unix prompt. Move to the directory "public_html".
  2. Open a file in "pico" (see above).
  3. Type <html></html> Everything else in the file should be between these two tags.
  4. Type <head><title>The title of your page goes here</title></head> Then go to a new line.
  5. Type <body> <p>Some text. It can go on as many lines as necessary</p> </body>
  6. Between the </p> and </body> add a link:

  7. <p><a href="http://home.gwu.edu/~robinson/math181/math181.html">Math 181 Home Page</a></p>
    This link is to the course homepage.
  8. Between the first link and the </body> add a second link:

  9. <p><a href="http://gwis2.circ.gwu.edu/~yourname/math181/assignments.html">My Math 181 Assignments</a></p>
    This link is to the course homepage.
  10. Save the file as "index.html"
  11. Open this file in netscape "http:/usr/people/user/~your_name/index.html"



  12. If you can't see the page, try the following:
  13. Open a Unix shell and type "ls -l" to see the permissions.
  14. Type "chmod a+rx public_html" so that others can look at your page. Try "ls -l again". The "a+rx" means let "all" users "read" and "xecute" files in public_html.
  15. "cd" to "public_html" and do the same to the file "assignments.html".
  16. Now create the rest of your web-site the same way. Good luck!