Familiarize with Pico Text Editor

Pico (Pine composer) is a text editor for Unix and Unix-based computer systems. Pico is very simple to use and offers features such as paragraph justification, cut/paste, spelling checker, search and replace, etc. Pico does not support working with several files simultaneously and cannot perform a find and replace across multiple files. It also cannot copy text from one file to another. You can use Pico to change your account configuration files or write a computer program source code file. However, this program doesn’t have as many features as some other popular Linux text editors (such as vi). By comparison, popular Unix text editors such as vi and Emacs provide a wider range of features than Pico; including regular expression search and replace, and working with multiple files at the same time. Pico is not truly open source, and most Linux distributions don’t even include Pico as a text editor. In fact, Ubuntu even links the command Pico to nano. Pico’s simplicity makes it suitable for beginners.

Pico is based on the pine message composer. As with pine, commands are displayed at the bottom of the screen, and context-sensitive help is provided. As characters are typed they are immediately inserted into the text. PICO does not have many commands – you can learn them within an hour or so. But these commands are the commands you would definitely need to edit a text. PICO’s commands are one-key only, ie there are no commands where you have to issue a sequence of two or more keys. PICO is always in “insert mode”, ie all letters are never interpreted as commands but inserted into the text. This is less confusing to a beginner than modal editors where letters can be interpreted as commands depending on the mode.

 

Basic operations

Pico displays a menu bar of commonly-used commands at the bottom of the screen. Pico accepts commands from your keyboard but not from your mouse. Inserting a character is done by pressing the corresponding character key in the keyboard while giving commands is done using a control key.

 

Running Pico

At your Unix shell prompt, type pico filename, replacing filename with the name of the file you want to create or edit. For example, if you want to edit a file named test.txt type:

$ pico test.txt

If the file named test.txt exists, then the first page (or screen) of the file is displayed; if the file does not exist, then an empty file and screen are created into which you may enter text.

 

Inserting text

To insert text into your Pico editing screen at the cursor, just begin typing. Pico inserts the text to the left of the cursor, moving any existing text along to the right. Each time the cursor reaches the end of a line, Pico’s word wrap feature automatically moves it to the beginning of the next line.

 

Saving your work

To save your edited file to disk, press Ctrl/o. Pico displays the current filename. (To save the file under a different name, delete the filename that Pico displays and type a new one.) Press Return.

 

Cursor movement

To move the cursor, use the arrow keys or use Ctrl/f (forward), Ctrl/b (back), Ctrl/n (next line), Ctrl/p (previous line). See the “Command overview” (back page) for more cursor movement commands.

 

Deleting text

To delete the character to the left of the cursor, press Backspace, Delete, or Ctrl/h. To delete the character highlighted by the cursor, press Ctrl/d. To delete the current line, press Ctrl/k.

 

Pico Keystroke Commands

Basic key combinations used by the Pico editor are shown below.

Ctrl-a    moves the cursor to the beginning of the current

Ctrl-b    moves the cursor backward a character

Ctrl-d    deletes the character at the cursor position

Ctrl-e    moves the cursor to the end of the current line

Ctrl-f    moves the cursor forward a character

Ctrl-i    inserts a tab at the current cursor position

Ctrl-j    justifies the current paragraph

Ctrl-k    cuts selected text

Ctrl-l    refreshes the screen display

Ctrl-n    moves the cursor to the next line

Ctrl-p    moves the cursor to the previous line

Ctrl-t    invokes the spelling checker

Ctrl-u    pastes the text, which was the last cut, at the cursor position

Ctrl-v    moves the cursor forward one page

Ctrl-w    searches for a string of text

Ctrl-y    moves the cursor backward one page

 

If you need any further help, please do reach our support department.

Was this answer helpful? 0 Users Found This Useful (0 Votes)