How to use nano, a commandline text editor

Nano is another text editor for linux in the command line. In fact nano stands for ( Nano’s ANOther editor). It is an enhanced clone of the pico text editor. Unlike vi and vim, there aren’t as many cryptic ways to navigate through nano. The downside though is that nano will not run off a floppy disc like vi. Nano comes preinstalled with Debian and Ubuntu, but we must install it from the repo’s for Suse and Fedora.

  • On Suse as root: zypper in nano
  • On Fedora as root: yum install nano

nano.PNG

You can start nano simply by typing the program name

nano

or by naming a to be created document

nano new_file

or by specifying the name of an existing document

nano .bashrc

At the bottom of the screen you should see a bunch of commands. The caret (^) signifies holding down the control key and typing the letter. For example Ctrl + g (^G) with display a Help file with a bunch of information about using nano. Ctrl + x (^X) will exit the program and return you to the prompt. Ctrl + o (^O) or (f3) will write or save the file to the hard drive.

To cut a line make sure the cursor is on the line you wish to cut and press Ctrl + K and to Paste it elsewhere Ctrl+U. As you can see there’s far less options with nano but it does make for a far less complicated text editor when compared to vi.

Related Posts

  • No Posts Found

Tags: ,

Leave a Reply