Nano

From FarmShare

Revision as of 16:33, 14 December 2011 by Epoch (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Introduction

Pico is the default text editing program on the shared Unix workstations. To start Pico, type the command pico at the Unix system prompt. To edit a file that already exists, type pico plus the name of the file (with the relative or absolute pathname, if necessary). For example, to edit a document named "unix.doc", you'd type:

cardinal> pico unix.doc

Upon startup, Pico copies the contents of the specified file into an internal buffer, or work space. (If you didn't specify a file, Pico will create a new, blank buffer.) During the process of editing you'll make changes to this buffer, not to the contents of the original file. Your original file will remain unchanged until you explicitly tell the editor to write over this file with the contents of the edit buffer. You do this by using the ^o command. Therefore, if you quit an editing session without saving your changes, the file you worked on will remain as it was, before you began the editing session.

Most Pico commands are executed with CONTROL command sequences. To type a control sequence, hold down the CONTROL key and simultaneously type the designated letter. Control sequences are represented in this document with a caret sign (^) plus a designated letter. For example, to enter the command ^f (which moves the cursor forward one character), you would press the CONTROL key while simultaneously pressing the "f" key. Pico provides a brief menu of frequently used command sequences across the bottom of the screen. A larger list of Pico commands can be found at the end of this document.

Moving the cursor in Pico

The cursor indicates your position within the text of the buffer. There are two ways to move the cursor. On Macintosh machines, and on some PCs and workstations, you can use the arrow keys near the number pad. If that doesn't work, or if that option isn't available, use the command sequences shown in the "List of Pico Commands" below.

Editing text

Any editing that you do will affect the character immediately at or in front of the cursor. To insert text, move the cursor one position beyond where you want the new text to go, and then type as normal. Delete a character with the DELETE key. Please note that Pico wraps text to the next line by adding a carriage return. If you need the lines to wrap without carriage returns (useful when creating or editing Unix-based text files), use the command pico -w at the system prompt.

Saving your work

You should save your work periodically during an edit session to backup your changes. Frequent saving preserves your work in case the computer system crashes. To save any changes you have made in the buffer, type ^o. This writes the contents of the buffer over the original file.

Leaving Pico

To end a Pico editing session, type ^x. This exits Pico; if you didn't type ^o before exiting, you will be asked if you want to save the buffer first.

For more information


If you have more questions about Pico, submit a HelpSU request or call 5-HELP.

List of Pico commands

The caret symbol, "^", represents the CONTROL key. For example, to enter the "^b" command, you would press the CONTROL key while simultaneously pressing the "b" key.

Display help text.

^g, (F1)

Move Forward a character.

^f, (right arrow)

Move Backward a character.

^b, (left arrow)

Move to the Previous line.

^p, (up arrow)

Move to the Next line.

^n, (down arrow)

Move to the beginning of the current line.

^a

Move to the End of the current line.

^e
Move forward a page of text.

^v, (F8)

Move backward a page of text.

^y, (F7) Search for (where is) text, neglecting case.

^w, (F6)

Refresh the display.

^l
Delete the character at the cursor position.

^d

Mark the cursor's current position as the beginning of selected text.

^^

All the text between the mark set with the "^^"command and the cursor's position at the time you enter your next command will be indicated as selected text. Selected text is displayed in white characters on a black background. Note: Setting a mark when it has already been set will unselect the previously selected text.

Cut selected text (displayed in inverse characters).

^k, (F9)

If no text is selected, this will cut the entire line that the cursor is on. Note: The selected text's boundary on the cursor side ends at the left edge of the cursor. So, with selected text to the left of the cursor, the character under the cursor is not selected.

Uncut (paste) last cut text, inserting it at the current cursor position. ^u, (F10)

Insert a tab at the current cursor position.

^i

Format (justify) the current paragraph.

^j, (F4)

Note: paragraphs are delimited by blank lines or indentation.

Invoke the spelling checker.

^t, (F12)

Report current cursor position.

^c, (F11)

Insert an external file at the current cursor position.

^r, (F5)

Save work. (Output the current buffer to a file.)

^o, (F3)

Exit pico, saving work.

^x, (F2)

Personal tools
Toolbox
LANGUAGES