Nano – The CLI Text Editor

Windows Articles

Configure Samba File share Services with Ubuntu 20.04 LTS

Here, Today! let's discuss samba file share service with Ubuntu 20.04 LTS. If you need to share files between Linux and MS Windows...

Install Matomo on Ubuntu 20.04

Hello, friends. In this post, you will learn how to install Matomo on Ubuntu 20.04. It's quite useful to measure the traffic to our...

How to change DNS in Windows 10

Hi! Today we will talk a bit about networks. In fact, we will touch on a topic related to connectivity. Specifically we will see...

The new Windows 10 file explorer will arrive with 21H2 update.

Hello! Microsoft does not stop working (except at Christmas) to continue polishing to Windows 10. In fact, users are gradually receiving the 20H2 update....

How to create an FTP server in Android

Hello! How are you? Currently sharing files from your PC to Android can be more comfortable and easy, without the need to use a...

If you’re running Linux, then having a text editor at hand is extremely crucial as you may need to edit a number of system files. Nano is a powerful text editor for Linux systems. It’s available on most of the Linux distros out there. It’s more preferable to new users than the advanced vi/vim and emacs editor.

Nano offers plenty of features like line numbering, searching, syntax highlight and lots of others. Learning Nano is easy. As the editor is available on all the major Linux distros, you don’t have to worry about other text editors at all.

Installing Nano

In cases, your system may not come up with Nano, or you uninstalled it. You can easily get this text editor for your system. Run the following command(s) according to your Linux distro –

# Ubuntu/Debian

sudo apt install nano

# CentOS/Fedora

sudo yum install nano

You can also install Nano from source. Get the latest source code of Nano.

Then, run the following commands –

tar -xvzf nano-3.2.tar.gz

cd nano-3.2/

./configure

make

sudo make install

Nano usage

Let’s fire up Nano.

nano

This is the window of Nano. At the bottom, you’ll notice all the available actions you can perform.

Here’s a short list you need to keep in mind at all cost –

Write out – ^O (Ctrl + O)

Exit – ^X (Ctrl + X)

Search – ^W (Ctrl + W)

In the case of other options, you can easily check them out at the end of the window of Nano.

If you press ^G (Ctrl + G), the help option will pop up.

  • Creating a new file

Fire up Nano –

nano

Type something in there –

Save the file –

You can find out the file on the directory you were in.

 

Note – I’m using Bat as an alternative to the popular “cat” command. Learn more about Bat – a “cat” clone with lots of improvements.

  • Opening file with Nano

Run the following command –

nano ~/.bashrc

You can see that the file is available for reading and editing.

Sometimes, you need to locate to the exact line and column of the file. Use the following command –

nano +line,columns <file>

If you’re in need of editing any system files, make sure that you use “sudo” for avoiding any conflict.

sudo nano <file>
  • Copy and paste

Move the cursor to the place you want to copy the text –

Hold Shift and move the cursor with your arrow keys.

For copying the text, press “M-6” (Alt + 6).

 

For pasting the content, press “Ctrl + U”.

Note that Nano isn’t able to interact with the global system clipboard. The copy and paste are only limited within Nano. If you’re using a terminal emulator, you have to use the emulator’s system of copying and pasting from the lines.

Enjoy!

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

Configure Samba File share Services with Ubuntu 20.04 LTS

Here, Today! let's discuss samba file share service with Ubuntu 20.04 LTS. If you need to share files between Linux and MS Windows...

Install Matomo on Ubuntu 20.04

Hello, friends. In this post, you will learn how to install Matomo on Ubuntu 20.04. It's quite useful to measure the traffic to our...

How to change DNS in Windows 10

Hi! Today we will talk a bit about networks. In fact, we will touch on a topic related to connectivity. Specifically we will see...

The new Windows 10 file explorer will arrive with 21H2 update.

Hello! Microsoft does not stop working (except at Christmas) to continue polishing to Windows 10. In fact, users are gradually receiving the 20H2 update....

How to create an FTP server in Android

Hello! How are you? Currently sharing files from your PC to Android can be more comfortable and easy, without the need to use a...
x