VMware ESXi and vSphere Cluster Management

Pico Text Editor on Linux

Learn how to use the Pico terminal text editor on Linux, including opening, editing, saving, searching, and exiting files, plus why Nano is often used instead.

What Is Pico?

Pico is a lightweight, screen-oriented terminal text editor. A terminal text editor runs inside a command-line terminal instead of a graphical desktop window. Pico is designed for short documents, notes, and configuration files rather than complex software-development projects.

Pico originated as the editor included with Pine, an email client environment. Its interface emphasizes visible keyboard commands, so a beginner can edit a file without memorizing a large command language.

When Pico is open, the main area displays the document. Status messages and the current filename appear near the bottom, followed by a two-line command guide. The guide normally shows commands such as ^X Exit and ^O WriteOut.

Pico Availability and Licensing

The original Pico has historically had licensing and distribution limitations. As a result, many Linux distributions did not ship it as a standard editor, and some current repositories do not provide the original Pico package.

The command may also be absent from a modern installation. On some systems, including systems in the Ubuntu family, pico may be a symbolic link or command alias that launches Nano instead. A symbolic link or command alias is a system-level mapping that causes one command name to run another program.

Check what is installed before relying on Pico-specific instructions:

command -v pico
pico --version
nano --version

The version command is not supported identically by every implementation. If pico --version fails, inspect the editor's title, startup text, or help screen. If pico is unavailable, Nano is usually the practical replacement.

Starting Pico

Open a New or Unnamed Buffer

To start the editor without specifying a filename, run:

pico

You can type text immediately. When you save, Pico asks for a filename.

Open or Create a Named File

Give a filename as an argument to open an existing file or prepare a new file:

pico notes.txt

If notes.txt already exists, Pico loads it. If it does not exist, Pico creates a new editing buffer and can create the file when you save.

Before editing a system configuration file, confirm the current working directory, make a backup when appropriate, and check whether elevated privileges are required. A file you can read may still require administrator privileges to save.

Essential Pico Keyboard Shortcuts

The exact labels and optional functions can vary between the original Pico, Nano compatibility modes, and different builds. The on-screen command guide and help screen are the authoritative references for the program currently running.

Task | Shortcut | Meaning

Help | ^G | Display the help screen.

Exit | ^X | Leave the editor; a save prompt may appear.

Save/write file | ^O | Write the current buffer to a filename.

Search | ^W | Find text in the document.

Replace | ^\ | Search for text and replace matches.

Cut text | ^K or a marked selection | Cut a line or selected text into the cut buffer.

Paste text | ^U | Paste the contents of the cut buffer.

Justify paragraph | ^J | Reformat a paragraph by wrapping its lines.

Spell check | ^T | Run spelling support when available.

Go to line | ^_ | Move to a specified line and, where supported, column.

Saving, Exiting, and Responding to Prompts

Save the Current File

Press Ctrl+O, shown in the guide as ^O. Pico displays a filename prompt. Keep the current name and press Enter, or type a different name before pressing Enter.

Writing to another filename creates a separate copy or saves the current text under that new name, depending on the editor implementation. Verify the filename carefully before confirming.

Exit the Editor

Press Ctrl+X. If the buffer has changed, Pico asks whether to save it. The prompt normally offers choices similar to:

  • Yes: save the changes, then confirm or enter the filename.
  • No: discard unsaved changes and exit.
  • Cancel: remain in the editor.

Read this prompt carefully when editing an important file. If you exit without saving, the changes in the editor buffer are discarded.

Basic Text Editing

Move the Cursor

Use the arrow keys to move through the text. Page-up and page-down keys, or the editor's page navigation commands, move through longer files. The cursor location may be shown in the status area.

Enter and Delete Text

Type characters normally. Press Enter to create a new line. Use Backspace to delete the character before the cursor and Delete to remove the character at the cursor when the terminal and implementation support it.

In Pico-style editors, ^K commonly removes the current line. If text is selected, the same command can cut the selected text. This puts the removed content in a temporary cut buffer, which is editor storage used to hold cut text until it is pasted.

Press ^U to paste the cut buffer at the cursor. Selection and marking commands can differ between Pico versions and Nano compatibility implementations; consult ^G if you need to select only part of a line.

Search, Replace, and Formatting

Search for Text

Press Ctrl+W, enter a word or phrase, and press Enter. Pico moves to a matching occurrence. Repeat the search command to continue looking, if supported by the current implementation.

Search and Replace

Use the replace command, commonly Ctrl+\. Enter the text to find, then enter its replacement. The editor may ask what to do for each match. Depending on the implementation, you can replace one occurrence, skip it, or replace all matching occurrences.

For configuration files, search for the setting name first, inspect the surrounding text, and change only the intended value. Avoid replacing every match unless you have confirmed that all matches should change.

Justify a Paragraph

Justify means reformatting paragraph text, usually by wrapping lines to fit a chosen width. Put the cursor inside the paragraph and press ^J. Inspect the result because justification may change line breaks without changing the words.

Spell Checking

Press ^T where spell-check support is available. Some builds rely on an external spelling utility. The command may be missing if the editor was built without integration or the required utility is not installed.

Understanding the Pico Screen

The editor normally has three useful areas:

  • Text area: the document you are editing.
  • Status and filename area: messages, prompts, and information about the current file.
  • Two-line command guide: the most important available shortcuts, written with caret notation.

The command guide is not merely decoration. When a prompt is active, its displayed choices may replace the normal guide. Read the current prompt before pressing a key.

Practical Examples

Create a Small Text File

  1. Open a terminal and run pico notes.txt.
  2. Type a short note, such as Remember to review the backup..
  3. Press ^O, accept notes.txt, and press Enter.
  4. Press ^X to exit. If asked to save, choose the save option.
  5. Run pico notes.txt again and confirm that the note is present.

Edit a Configuration-Style File

  1. Make a backup before a significant change.
  2. Open the file by name, for example pico application.conf.
  3. Press ^W and search for the setting.
  4. Move to its value and edit it carefully.
  5. Press ^O and verify the filename before confirming.
  6. Exit with ^X, then test the application or configuration safely.

Replace Repeated Wording

  1. Press ^\.
  2. Enter the recurring word or phrase.
  3. Enter the replacement text.
  4. At each prompt, choose whether to replace, skip, or replace all, depending on the available choices.
  5. Search again afterward to verify that the intended occurrences changed.

Reformat a Pasted Paragraph

  1. Paste or enter the paragraph with awkward line breaks.
  2. Place the cursor inside that paragraph.
  3. Press ^J.
  4. Inspect the new wrapping and undo or correct it if the paragraph boundaries were not recognized as intended.

Determine Whether pico Is Actually Nano

  1. Run pico.
  2. Inspect the title, startup information, or help screen.
  3. From another terminal, run pico --version if supported.
  4. Compare the displayed commands and version information with nano --version.

If the command launches Nano, treat Nano's displayed help and documentation as the authoritative reference. Most basic Pico-style shortcuts remain familiar, while Nano may provide additional features.

Pico Compared with Nano and Other Editors

Editor | Interface type | Learning curve | Availability | Best use case

Pico | Terminal-based, command-guide-driven | Low | May be absent or provided through a compatibility mapping | Quick edits and simple documents.

Nano | Terminal-based and closely modeled on Pico | Low | Commonly distributed on Linux systems | Practical replacement for Pico and routine terminal edits.

Vi/Vim | Modal terminal editor with extensive commands and customization | Moderate to high | Very common on Unix-like systems | Efficient advanced editing, programming, and remote administration after learning its modes.

KWrite or another graphical editor | Desktop graphical window | Low to moderate | Depends on the installed desktop environment and packages | Comfortable editing when a graphical session is available.

Nano closely follows Pico's interaction style and common shortcut conventions. For a beginner, Nano is usually the best choice when the original Pico is unavailable.

Vi/Vim and Emacs offer much larger feature sets, extensibility, and powerful editing workflows, but they have steeper learning curves. Their command systems are different from Pico's, especially Vim's normal and insert modes.

A graphical editor such as KWrite may be preferable when you have a desktop session and want menus, mouse selection, tabs, syntax highlighting, or easier clipboard integration.

Pico is suitable for quick edits and straightforward text. It is not intended to provide the advanced extensibility, scripting, modal workflows, language tooling, or large-project features found in more powerful editors.

Choosing the Right Editor

  • Choose Pico if it is installed and you want a minimal, guided terminal editor.
  • Choose Nano when Pico is unavailable or when you want the same general interaction style on a modern Linux system.
  • Choose Vi/Vim when you need advanced terminal editing, automation, or a tool commonly available on remote systems and are willing to learn its modes.
  • Choose Emacs when you want a highly extensible environment with editing, programming, and other integrated workflows.
  • Choose KWrite or another graphical editor when a desktop interface is available and preferred.

Always check which editor is actually installed before following instructions. A command name can be missing, mapped to a different implementation, or behave differently because of compatibility options.

Troubleshooting

The Shell Says pico Was Not Found

Possible causes include Pico not being installed, the distribution not packaging the original Pico, or the command directory not being in the shell's PATH.

  • Run command -v nano or nano --version.
  • Use Nano as the Pico-style alternative if it is installed.
  • Use the distribution's package search tools to see which editor packages are available.
  • Do not assume that an old Pico package name exists on every distribution.

Running pico Opens Nano

The operating system may map pico to Nano for compatibility. Use the editor's own help and version information as the reference. Basic commands such as save, search, cut, paste, and exit should be familiar, but Nano may expose extra options.

Ctrl Shortcuts Do Not Work

First verify that you are holding Ctrl while pressing the letter. A terminal, remote session, multiplexer, or keyboard mapping may also intercept a key combination.

  • Read the current on-screen help for alternate bindings.
  • Test the same command in a local terminal if a remote session changes key behavior.
  • Check whether the terminal emulator or an intermediate tool has assigned the shortcut to another action.

You Cannot Exit

^X starts the exit process. If the file has unsaved changes, answer the save prompt: save, discard, or cancel. When editing an important file, choose cancel if you are uncertain and inspect the buffer before trying again.

Spell Checking Is Unavailable

Optional functions depend on the installed implementation and system tools. Check the help screen to see whether spell checking is supported, and use another spelling utility if the required integration is absent.

Exam-Relevant Notes

  • Pico is a simple terminal text editor historically associated with the Pine email environment.
  • Nano is a widely distributed editor designed to be Pico-compatible in interface and common shortcuts.
  • ^X means Ctrl+X because Pico uses caret notation.
  • ^O commonly writes or saves a file, while ^W searches.
  • Pico may not be installed because of historical licensing and distribution limitations.
  • The pico command can launch Nano through a symbolic link or command alias.
  • Always read the save prompt before exiting, especially after editing a protected configuration file.

For a related introduction, see the Pico Text Editor guide.