pico how-to

This is the pico how-to. If you would like to know more about pico, click here.
quick links
Jump to a part of this page:
 the screen
 moving around
 save and exit
 other commands
 command reference
You access pico from a UNIX terminal command line. (Think of the old C-prompt in DOS.) This could be in a telnet window, an X-terminal, or on the monitor of a UNIX servier itself. From the command line, type pico filename, where filename is the name of the file you want to edit. If you leave out filename, you will be presented with an untitled file, also called a New Buffer.
the screen
Once you are in pico, you should see the screen divided into three sections. The top of the screen is the title bar. It lists the program name (UW PICO(tm)), the program version (3.5), the name of the file that is being edited (File: pico.shtml), and whether or not the opened file matches its saved state (if it doesn't, Modified appears in the upper right).
Most of the screen is taken up by the second section, which displays the contents of the file you have chosen to edit. (If you just typed pico, without specifying a filename, this section of the screen will be empty. (We'll look at moving around within this section in just a moment.) On some systems, the file contents may scroll off the right side of the screen; in this case, a dollars sign ($) will appear in the last text column of the line. In many systems, however, text is set to wrap mode, which prevents a line of text from being longer than 72 characters or so.
The last two lines of the screen display the "Help Bar," the third and final section. All of the commonly used commands are listed here for your convenience. The little carrat symbol (^) means the "control" key; for example, ^G means to press the control and G keys at the same time.
moving around
Movement is accomplished primarily through the arrow keys. However, it is possible to quickly scroll up or down by using ^Y (page-up) or ^U (page-down). You can also fast forward to the end of a line by pressing ^E; to get to the beginning of the current line, press ^A.
The search feature in pico is not terribly advanced, but it gets the job done. You access it by pressing ^W (for "where is"). The help bar is temporarily replaced by the Search []: prompt. (Any text that appears between the square brackets [] is the default search term -- just hit enter.) Type the word or words you are searching for. pico's search feature is not case-sensitive (meaning "George Washington" is the same as "gEOrgE wAshIngtOn"). It also automatically wraps back to the beginning of the file if the search term is not located between the current location and the end of the document.
You can also use the search command (^W) to quickly jump to the beginning or end of the current file. Simply press ^W, followed by ^Y to jump to the start of the file; ^W and ^V to jump to the end.
Cutting and pasting within pico is probably the least pleasant part of the program. The two commands are ^K and ^U. ^K cuts the entire current line, regardless of the cursor position. ^U pastes the cut text back at the cursor's current position and inserts a line break at the end.
You can cut more than one line of text at a time by simply pressing ^K as many times as you need. Note, however, that pressing ^K after moving the cursor in any way will replace the "clipboard" rather than add to it!
If you just need to cut a small portion of a line, or if you need to cut more than a few lines, you can "mark" the text. Begin by placing the cursor at the beginning of the text to be marked. Then press ^^ (control+shift+6 on most keyboards). Next, move the cursor to the end of the text to be marked. You will notice that the marked text appears in reversed colors (black on white instead of white on black, for example). Lastly, press ^K to cut the marked text. This method is especially powerful when used in conjunction with ^U and ^Y.
save and exit
When you are done with your changes, you can either save them and keep working, or save and exit pine. To save the changes and keep working, press ^O. You should see the Modified notice in the upper right disappear, and a message will temporarily appear just above the help bar telling you how many lines of text were saved. To save your changes and quit pine, press ^X. You will be prompted for a file name to write out -- you should usually just press ENTER here -- and then you will be returned to the command line. (If you saved your file with ^O first, then you won't be prompted for the file name.)
other commands
Other commonly used commands allow you to insert other files into the current one, check the file for spelling, and justify the text.
To read in a file, press ^R. This presents you with a prompt similar to the search prompt. If you know the path and name of the file, you can type it in here and press ENTER. Otherwise, press ^T to bring up a directory listing of your files. You can navigate through this list as if it were a file, including search and page-up/down. When you have highlighted the file you want to insert, press ENTER.
The dictionary used for spell-checking in pico is not terribly great, but it catches a lot of common spelling mistakes. (There is a way to define your own dictionary for pico to use; ask your system administrator ofr more information.) pico goes through possible spelling errors alphabetically; that is, all errors that start with the letter "a," then "b," and so on. Lowercase letters are searched first, then uppercase letters, then numbers.
To justify text, press ^J. This usually doesn't work the way I want it to work, so I generally avoid using it. (It works best when you are dealing with prose text -- paragraphs -- and tends to handle formatted code very poorly.)
command reference
^A move to beginning of line
^B move backwards 1 character
^C current location of cursor
^D delete under cursor
^E move to end of line
^F move forward 1 character
^G help text
^H backspace
^I insert tab
^J justify paragraph
^K cut line or marked text
^L refresh screen
^M line break (return)
^N move down 1 line
^O save file
^P move up 1 line
^Q enable screen output
^R insert file
^S suspend screen output
^T spell check
^U paste cut text
^V page down
^W search
^X save and exit
^Y page up
^^ mark text

NOTE: ^Z is the UNIX suspend command,
but it only works if suspend_enabled
is selected... Don't ask...


[an error occurred while processing this directive] [an error occurred while processing this directive]