Presbyterian College > Academic Web Server > Support > Web Pages > Pico


Creating and Editing Web Pages with Pico

If you don't want to use web-page authoring software, but prefer instead to edit your HTML code by hand, you can log onto web.presby.edu via telnet or SSH, and edit your HTML files using the pico text editor at the Unix command line.

Logging onto the Server

First you must log onto the server. In general, there are two different kinds of software that you can use for this: telnet and SSH (secure shell). They differ in security:

We currently allow telnet connections to web.presby.edu from inside the campus network, but we require SSH connections from outside.

SSH under Macintosh OS X

If you use a Macintosh that is running OS X, we recommend that you use SSH, although telnet is also available, because it's just as easy to run one or the other.

  1. Find the Terminal application. It's normally in the Utilities subfolder of the Applications folder. If you think you're going to use it a lot, you might want to drag it into the dock at the bottom of your screen so that you can access it from there.

  2. Launch Terminal by double-clicking on it. You should get a mostly blank window with something similar to the following at the top:

    Last login: Thu Oct 28 11:49:34 on ttyp1
    Welcome to Darwin!
    [jtbell:~] jbell%

    The last line contains the Unix command prompt, which is the signal that you can enter a Unix command by typing it in and pressing return or enter. The first part, in brackets, gives the hostname of the computer that you're currently using, followed by a colon (:), then a tilde (~) that represents your home directory which is your current "location" in the file system on that computer. Normally in Mac OS X, your home directory is the folder /Users/yourloginid (mine is /Users/jbell on the computer that I'm using as I type this).

  3. At the Unix command prompt, type the command ssh yourloginid@web.presby.edu, substituting your actual login ID for yourloginid.

    If you have not logged into web.presby.edu from this computer before, you should now see the following message:

    The authenticity of host 'web.presby.edu (10.16.21.222)' can't be established.
    RSA key fingerprint is 6e:96:1f:39:46:ad:ca:fe:6d:de:10:b5:6f:99:f4:47.
    Are you sure you want to continue connecting (yes/no)?

    Type yes and press return or enter. You should now see the following:

    Warning: Permanently added 'web.presby.edu,10.16.21.222' (RSA) to the list of known hosts.

    and then something similar to the following:

    Last login: Thu Oct 28 11:50:29 2004 from 10.16.1.40
    Welcome to Darwin!
    [titanium:~] jtbell%

    You will not get the warning message again when you log in from the same computer again. The login message that followed is basically the same thing that you saw when you started up Terminal originally, but now it indicates that you are "talking" to the server. The server's hostname is actually titanium; web.presby.edu is an alias for it. Your current "location" is now your home directory on titanium. (In the example above, my login ID on titanium is jtbell.)

At this point you can skip ahead to the section Navigating to Your Web Pages.

Telnet under Microsoft Windows

(forthcoming)

SSH under Microsoft Windows

(forthcoming)

Navigating to Your Web Pages

Now you need to enter the directory (folder) where your Web pages are located. To do this, use the Unix cd (change directory) command:

This doesn't give you any visual feedback, so to make sure you're where you want to be, use the Unix ls (list) command to get a listing of the files in the current directory. You should get something like the following, which is what I got when I did it in the directory where this page is located:

[titanium:WebServer/Documents/support] jtbell% ls
access.html             newsgroups              ssh-howto.html
counter.html            pico.html               ssh-howto.txt
download-mail.html      ppp.html                webpage-howto.html
index.html              responsibility.html     webpage-policy.html

Editing Your Web Pages

To edit a page, use the pico command. For example, to edit this very page, I used:

[titanium:WebServer/Documents/support] jtbell% pico pico.html

You should now see the beginning of the HTML code for that page, along with some other information. If that page doesn't exist already, pico will open a blank screen, and then save the file under the name you gave, when you quit. The editing cursor is a small solid black box that indicates your current position in the file.

   UW PICO(tm) 4.8                File: pico.html                  Modified   

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">

<html> 

<head> 
<title>Creating and Editing Web Pages with Pico</title>
</head>

<body>

<p> <a href="http://www.presby.edu/">Presbyterian College</a>
&gt; <a href="../"> Academic Web Server</a>
&gt; <a href="./">Support</a>
&gt; <a href="webpage-howto.html">Web Pages</a>
&gt; Pico  </p>

<hr>


^G Get Help  ^O WriteOut  ^R Read File ^Y Prev Pg   ^K Cut Text  ^C Cur Pos   
^X Exit      ^J Justify   ^W Where is  ^V Next Pg   ^U UnCut Text^T To Spell  

Basic editing is rather simple. Move the cursor with the arrow keys (not with the mouse!). To insert something at the location of the cursor, just type it in. To delete what's to the left of the cursor, hit the delete key. You can do other things using the commands listed at the bottom of the editing screen. For example, ^G means to hold down the control or ctrl key and type a g ("control-G" or "ctrl-G"); it takes you to a help screen that describes the other commands.

When you're finished, hold down the control or ctrl key and type an x ("control-X"). Pico then asks you if you want to save your changes (usually you'll answer y), and then to confirm the name of the file (hit return or enter to keep the name, or backspace over it to change it, then hit return or enter. At this point you should see the Unix command prompt again.

Logging Out

When you're all finished, and are back at titanium's Unix command prompt, hold down the control or ctrl key and type a d ("control-D" or "ctrl-D") to log out of titanium. If you're using the Mac OS X Terminal program, you'll now see the Unix command prompt for the computer you're sitting at; type control-D again, then quit from Terminal. If you're using Windows Terminal or some other software, you can probably now simply quit.


Presbyterian College > Academic Web Server > Support > Web Pages > Pico


This page was last updated on 9 November 2004. If you have questions or corrections, please contact the Web Servant (webservant at presby.edu).