Pico/Nano - A Basic Text Editor

What is a Text Editor?

Errr... what is a text FILE?

A text file is exactly what it sounds like. A file that is simply composed of text characters (those you find on your standard keyboard). Many may think that files like .doc, .docx, .rtf or other similar files are "text files" but they are not. These special files contain many other entities that allow them to open in certain programs or display in certain fashions. A strict text file is as simple as you can get. To create, edit, and view text files, one needs a text editor. There are three text editors available to us on our Unix Systems: Pico (nano), VI, and Emacs. Find one you like, and master it!

Using Pico

Starting up the editor

Pico (or nano) is arguably the most basic text editor that is available for use on Unix systems. It's not as powerful as the others, but it is easy to learn and simple to master. To open the pico text editor, type pico. This will open the text editor with a new text file (empty) with no name (yet).
If you'd like to open an already existing file, type pico and then the file's name, ex:
>pico file.txt
If you'd like to open pico with a new file, but name it at the same time, type pico and then the name of the file you want to create. Pico will create it for you.
>pico newfile.dat
You'll notice the extension can change... extensions in Unix are simply a part of the filename. We can name files however we'd like! Give this one a try (just some random filename... really.)
>pico melina.isdabomb

Pico Commands

Common commands:

Once you're inside the editor, type away! Use your arrow keys to navigate the text file.
You'll also want to get familiar with these common commands (the ^ means the ctrl key):
^o	Save (write out)
^x 	Exit Pico
^^	Begins marking text at current position (means ctrl+shift+^)
^k	Cut
^u	Paste
^y	Page up
^v 	Page down
^c	Current Cursor position

Above are some of the more commonly used commands. Don't worry though, there's TONS more!

More commands (for completeness):

(arrows)Move cursor
(bksp) 	Move cursor left one space, deleting character
^a  	Move to beginning of line
^b  	Move back one character (same as left arrow)
^e 	Move to end of line
^f 	Move forward one character (same as right arrow)
^n  	Move to next line (same as down arrow)
^p  	Move to previous line (same as up arrow)
^(space)Move to next word
^d 	Delete character at current position
^g 	Display help file (^V and ^Y to scroll through)
^h 	Delete previous character (same as bksp)
^i 	Insert TAB character (same as tab)
^j 	Justify paragraph
^l 	Redraw screen
^r 	Insert text from a file you deleted. Can also "unjustify"
^w 	Search file for text

Back to Course Homepage
(c) Melina Vastola, 2015