Linux

How to Install and use Nano Text Editor Commands in Linux

When working on the command line, quite often you will need to create or edit text files or any kind of file to edit. Two of the most powerful and popular command-line editors are Vim and Emacs. Both of them have a steep learning curve that can be intimidating to new users. For those who need a simple editor, there is nano.

GNU nano is an easy to use command line text editor for Unix and Linux operating systems. It includes all the basic functionality you’d expect from a regular text editor, like syntax highlighting, multiple buffers, search and replace with regular expression support and more.

What is GNU Nano Editor

GNU nano is a one of the popular and easiest command line text editor used on many operating systems including Unix-based systems and BSD variants.

How to install GNU Nano Text Editor

Some OS distributions comes with Nano editor installed ,therefore install nano depends on OS.

Install GNU Nano Text Editor on Debian / Ubuntu

    
     sudo apt-get install nano
    
   

Install Nano Text Editor on CentOS / RHEL

    
     yum install nano
    
   

GNU Nano Text Editor Common Commands

To edit a file you can type the following command , in case the file not exists the Nono editor will create new file on save the file.
    
     nano sample.text
    
   

Here is some basic nano commands might help you while editing file:

  • CTRL + A :Jump to the beginning of the line.
  • CTRL + E :Jump to the end of the line.
  • CTRL + V :Scroll page up.
  • CTRL + Y :Scroll page down.
  • CTRL + W :Search for a specified phrase in your text. To search for the same phrase again press ALT + W.
  • CTRL + K :Cuts the entire selected line to the “cut buffer”.
  • CTRL + U :Pastes the text from the “cut buffer – Memory” into the selected line.
  • CTRL + J :Justifies the paragraph.
  • CTRL + _ :Go to specified line and column number.
  • CTRL + C : See where your cursor currently is.
  • CTRL + X :Exits Nano text editor. In case you made any changes to the file, it will prompt a save request.
XsoftHost Support

Share

Recent Posts

Add Extra IP addresses to server configuration On Ubuntu 17.10 and later

Each failover IP address will need its own line in the configuration file. The configuration…

4 years ago

Create RAID Arrays with mdadm on Ubuntu

What is mdadm? The mdadm utility can be used to create and manage storage arrays…

4 years ago

How to change the maximum upload file size for PHP

There are several scenarios that you might need to increase or decrease your php maximum…

6 years ago

How to install Let’s Encrypt Plugin in WHM/cPanel

What is Let’s Encrypt? Let’s Encrypt is a free certificate authority provided by the Internet…

6 years ago

How to install python in my cPanel and add py extension

Python normally installed on all cPanel hosting server because most of Centos/red hat update system…

6 years ago

How to install and enable GUI GNOME Desktop on centos 7

Usually CentOS 7 comes in a numbers of variants, For most users, there are two…

6 years ago