Difference between revisions of "Training/Linux - Nano editor"

From HPC
Jump to: navigation , search
m
m
Line 6: Line 6:
  
 
[[File:nano1.jpg]]
 
[[File:nano1.jpg]]
 +
 +
=== Starting Nano ===
 +
 +
For opening and creating files type:
 +
 +
<pre style="background-color: black; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 +
 +
[username@viper ~]$ nano filename
 +
 +
</pre>
 +
 +
'''Nano''' is a mode-less editor so you can start typing immediately to insert text. If you are editing a configuration file like ''/etc/fstab'' use the -w switch to disable wrapping on long lines as it might render the configuration file un parseable by whatever tools depend on it.
 +
 +
For example:
 +
 +
<pre style="background-color: black; color: white; border: 2px solid black; font-family: monospace, sans-serif;">
 +
 +
[username@viper ~]$ nano -w /etc/fstab
 +
 +
</pre>
 +
 +
== Commands ==

Revision as of 14:35, 28 February 2017

Introduction

Nano is a text editor for Viper and is invoked using the command line interface. It emulates the Pico text editor, part of the Pine email client, and also provides additional functionality. Nano is easier to use and learn than Vi. However Vi has the advantage of being installed almost universally on every Unix/Linux system by default and is quicker to edit with once its interface is learnt.

Below is how nano appears on the screen of a terminal connected to Viper:

Nano1.jpg

Starting Nano

For opening and creating files type:


[username@viper ~]$ nano filename

Nano is a mode-less editor so you can start typing immediately to insert text. If you are editing a configuration file like /etc/fstab use the -w switch to disable wrapping on long lines as it might render the configuration file un parseable by whatever tools depend on it.

For example:


[username@viper ~]$ nano -w /etc/fstab

Commands