Pico is a file editor used on UNIX systems. It comes with pine, where it is used by default to compose new messages, but it can also be used as a stand-alone editor. It is invoked by the command pico filename, where filename is replaced with the name of your file.
Editing commands are invoked by control key sequences (i.e. pressing the control key together with another key.*) Several menu-like status lines at the bottom of the screen show which commands are active at any given time. Key strokes that do not constitute control key sequences are entered as text at the current cursor position.
* (The old version of this file said you use use: "on a Macintosh, pressing the Escape key twice, then another key" instead of pressing the Ctrl key. Well, on Mac OS X, the Ctrl key works, as well as Escape-Escape.)
Ctrl-a |
Beginning of current line |
Ctrl-e | End of current line |
Ctrl-v | Forward one screen |
Ctrl-y | Backward one screen |
Ctrl-f | Forward a character |
Ctrl-b | Backward a character |
Ctrl-p | Previous line |
Ctrl-n | Next line |
Ctrl-d |
Delete the character the cursor is on |
Ctrl-e | Delete to end of current line |
Ctrl-k | Delete the line the cursor is on |
Ctrl-u | Restore the last line that was deleted |
To move to the last line in the file, type Ctrl-w (where is), Ctrl-v (last line). To move to the first line of the file type Ctrl-w (Whereis), Ctrl-y (first line).
By default, Pico 'wraps' lines at 80 characters. It will not break text in the middle of a word, however, but will go back to the most previous white space. This default can be overridden by starting Pico with the -w option. When this is in effect, lines too long to be displayed on the screen will have a '$' in the column furthest to the right.
-w | Disables word wrapping |
+x | (x is an integer) Starts the cursor x lines into the buffer |
-nx | (x is an integer) Checks your mailbox every x seconds and notifies you if you have new mail. |
Read a file into pico with Ctrl-r and write one from pico with Ctrl-o. After either of these commands, you can enter Ctrl-t (list files) to invoke the file browser. The file browser will allow you to step through the directory structure, see a listing of all files in a given directory, copy files, rename files, and delete files.
Pico may seem easier to start, and I guess it is, but if you're going to be using Unix much, in the long run you'll probably want to learn vi. In spite of its intrinsic Unix-ness, I like vi better than pico or even the.