Nano is a useful text editor for the command line interface in Linux systems.  It emulates the Pico text editor, and is part of the GNU GPL.  Nano is keyboard oriented with control keys.  By learning some of the keys below, you will be able to quickly edit files from the nano editor.  Once you pick this up and learn more about using Linux by the command line you can then move onto more advanced editors like vim and emacs, which are great, but often have a bit of a learning curve.

Nano is easy to use and great for beginners.  It is often installed by default in Ubuntu and other distros and works very well with sudo from the command line. It’s a WYSIWYG editor; “what you see is what you get.”

nanoTo install nano on Linux:

sudo apt-get install nano

If to launch nano in Ubuntu enter:

sudo nano yourfilename.txt

For a complete list of commands and help press:

Ctrl + G

When you are done looking at the list press Ctrl+X to exit

Saving a new file:

Let’s say you’re working on a new text file and you want to save it. This is executed by hitting:

Ctrl + O

You’ll be prompted for a filename to use, and the control shortcuts will change to reflect the options that are available

Inserting contents of another file:

If you want to insert the contents of another file into your new file hit, Ctrl+R.

Cancel Previous Commands:

Ctrl + C

Move Curser Forward or Back:

Ctrl + F or Ctrl + B

Move Line Up or Down:

Ctrl+P and Ctrl+N

Move Up or Down a Page:

Ctrl + Y or Ctrl + V

Delete Entire Line:

Ctrl + K

To Search For Text Use:

Ctrl + W

 

 

Pin It on Pinterest

Share This

Share this post with your friends!

%d bloggers like this: