Using the Pico Editor: a Tipsheet

The pico editor

To create and edit files on a central UNIX server, you can use the text-editing program called "pico". Pico is a simple editor in which available options are displayed across the bottom of the screen.

To create or edit a file using pico, at the UNIX prompt (represented by the % character), type

pico filename

and press the ENTER key. Replace filename with the name of the file you want to create or modify.

Creating a new file

In the following example, you will see how to use pico to create a file named "testfile."

  1. Type pico testfile

    and press the ENTER key.

    pico editing window

    In the upper-left corner of the screen, you will see the version of pico that you are using (e.g., PICO 2.9). To the right of the version number, you will see the name of the file that you are creating (e.g., "File: testfile").

    Across the bottom of the screen, you will see the options you can use. The "^" character represents the CONTROL (CTRL) key. To select one of these options, you must hold down the CTRL key while pressing the corresponding letter key. For example, to "Get Help," press the CTRL key while pressing the letter G key.

  2. Type some text for the file.

    If you make a typographical error, you can use the BACKSPACE or DELETE key to delete a character to the left of the cursor. To delete a line ("Cut Text"), use the ^K option; to undelete a line ("UnCut Text"), use the ^U option.

Saving a new file

  1. To prepare to save the file and exit pico, use the ^X ("Exit") option.
     
  2. You will see the program message, Save modified buffer:(ANSWERING 'No' WILL DESTROY CHANGES)?

    Press the Y key.

  3. You will see the program message, File Name to write: testfile

    Press the ENTER key.

    You will see a message indicating how many lines are included in the file.

Editing an existing file

To edit an existing file, at the UNIX prompt (%), type

pico filename

and press the ENTER key. Replace filename with the name of the file you want to edit. After you make changes, save the file again following the steps outlined above.

Some editing options are described below:

^C

Cur Pos

determine where the cursor is in the file

^G

Get Help

go to an online help menu

^J

Justify

justify the text in the entire paragraph

^O

WriteOut

save the text you've written without quitting pico

^R

Read File

include a previously written file in your current text

^T

To Spell

check the spelling in the file

^V

Next Pg

move the cursor to the next page of the file

^W

Where is

search for character string patterns

^Y

Prev Pg

move to the previous page of the file

Getting online help

If you need help while you are working with pico, you can use online help at any point by pressing the appropriate "help" option displayed at the bottom of the window (e.g., ^G to "Get Help").