Debian Admin - Your way to Debian World

September 22, 2006

Nano editor tutorials

by @ 9:44 am. Filed under General

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Nano command line editor is a text editor that can be run from a command prompt via a telnet or ssh session. It allows you to create or edit HTML, text, scripts or practically any text file. Although it is not as easy as a GUI based editor you may be used to it does afford you the luxury of being able to create and edit your site files from almost any computer in the world.

nano is a small, free and friendly editor which aims to replace Pico,the default editor included in the non-free Pine package. Rather than just copying Pico’s look and feel, nano also implements some missing (or disabled by default) features in Pico, such as “search and replace” and “go to line number”.

Install nano in Debian

#apt-get install nano

Now we are going to craete a test file in nano editor

At the prompt type the following and hit enter.

#nano test.htm

Enter the filename

Now you have launched nano with a new blank file named “test.htm”. If you wanted to edit an existing file you would type “nano” and the name of the file. Now you can see how the window has changed.
Nano Main Screen

The first thing you may notice is the “GNU nano 1.3.12″ in the upper left corner. GNU Nano 1.3.12 is telling you the program and it’s version.

In the center of the top bar it tells you what file you are editing.

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 “{cntrl} g” (^G) with display a Help file with a bunch of information about using nano. “{cntrl} x” (^X) will exit the program and return you to the prompt. “{cntrl} o” (^O) or (f3) will write or save the file to the servers harddrive.

You should see the prompt just below the “GNU nano 1.3.12″ text. This is where you can begin typing.

Nano Text Entering

This is test web page we are creating for our test purposes.

Now we want to write or save the file. We do this by holding down the {ctrl} key and pressing “o” or “f3″ the function key.

Nano Saving file

Notice how the screen has changed towards the bottom left. It is now asking you if you want to save this file with this name. If you do press enter. If you do not either hit {escape} or enter the name you want the file named as.

Nano saving file

Now you need to hit enter and saved the “test.htm” file and you can see at the middle bottom of the screen it says “[ Wrote 5 line ]”. There was only one line in this file and nano talks in lines.

The last step is to quit nano, {ctrl} x. If everything has gone well we should be back at the command prompt.

If you want more details you need to check nano editor man page

Tags: , , ,

Leave a Reply

Subscribe RSS Feed

subscribe to the Debian Admin RSS feed

Internal links:

Sponsors:



Categories:

Support Debian Admin

Amount $:
Website(Optional):

Sponsors:

Archives:

Related Links:


Favourite Sites:

Wordpress Collection
Windows Reference
Ubuntu Geek
DebianHelp
All About Debian Tutorials
Power Electrical
Check Your IP Here
Debian,Ubuntu News
DebCentral
Tuxmachines
Capnkirby
Libervis
Nuxifield
Linux Horizon
Linux Appfinder
Debuntu
GNU/Linux For Everyone
Free Penguin
DebianAdmin is not related to the Debian Project.
This site is copyright © 2006,2007 Debian Admin
All Trademarks are the property of their respective owners.
The contents of this website may not be mirrored or archived without the express written permission of DebianAdmin Site Owner.

DISCLAIMER: All the information, troubleshooting methods, utilities offered in this website is provided AS-IS, without any warranties. Though I strive for perfection, and always test the validity and effectiveness of the troubleshooting content in various systems, I assume no responsibility for your use of these Fixes, Utilities and other troubleshooting advice. The author will not be liable for any special, incidental, consequential or indirect damages due to loss of data or any other reason. All use is completely at your own risk. Changes to the existing content and new additions are made to this website periodically, without notification.
Rodney's Kontera DynamiContext Plugin plugged in.