Basic guide to Nano editor
It's undeniable that, for new Linux users, using a terminal is a scary thing. But more frightening is still editing files at the terminal, with editors like Vim and GNU Emacs - very difficult for beginners. For example, even getting rid of Vim is a difficult task for many people.
Instead of complicating the problem, you can go back to the basics with a simple Linux editor: Nano. A lot of people love this tool, thanks to the simple interface, the powerful shortcuts that it includes, as well as common features like searching and numbering lines. This tutorial will show you how to use the Nano editor.
Open Nano on Linux
Nano comes pre-installed on most Linux distributions, so you don't need to install it. To run Nano, open a terminal and type the following:
nano
This command will open a blank file for you to begin writing.
If you want to open a file, type:
nano /folder/filename
Replace '/ folder / filename' with the location of the file you are trying to edit.
You can also do this with a file that doesn't technically exist. Nano will create a blank file with the file name specified at the location you provide.
Nano also allows you to open a file at a specific row or column. To do so, type the following:
nano +line-number,column-number filename
Replace 'line-number' and 'column-number' with the appropriate number of lines and columns, 'filename' with the name of the file. For example:
nano +4,12 file.txt
Nano will open the selected file at the position you given, ready for you to start editing.
Use Nano keyboard commands
As a terminal editor, you cannot use the mouse to navigate the Nano application. You will need to use keyboard shortcuts to open, save and close files as you like.
Some of these shortcuts are listed constantly at the bottom of the Nano window, but for reference, here are some common commands you can use.
Ctrl
+G
: Open the Nano help menu.Ctrl
+O
: Save the open file. Nano will ask you to confirm the file name when doing this, so just pressEnter
to confirm.Ctrl
+C
: Remove any pending orders.Ctrl
+X
: Exit Nano. This will also prompt you to see if you want to save the file, if you have made any changes to it. PressEnter
to confirm if you want to save changes.Ctrl
+W
: Open search box. Enter here to locate certain sections of text.Ctrl
+K
: Delete the current text line.Ctrl
+_
(underline): Move to certain lines. Enter the line number and press theEnter
button to confirm.Ctrl
+(backslash): Find and replace text. Enter the text you want to find instead, then press
Enter
.
There are other commands you can try. You can learn more from the Nano help menu ( Ctrl
+ G
). One of the most useful nano commands is text checking. This requires you to install an additional package, so if you use a Linux distribution based on Debian or Ubuntu, open a terminal and type:
sudo apt install spell
After installation, open Nano and press Ctrl
+ T
This will start a spell check for your document.
If you locate any text that is deemed incorrect, the tool will prompt you to correct it. Make changes, then press Enter
to save changes.
Edit the file from the Linux terminal
Nano is very simple and once you start using it, it's pretty easy to get to grips with everything. Although the more advanced text editors offer better features, the Nano retains its position thanks to its strengths - editing files without creating any inconvenience or problems. what.
If you don't like Nano and are looking for a better alternative, you can try some of the best Linux editors like Vi or Scribes instead.
You should read it
- Is Vim or nano the best Terminal editor?
- How to install and use GNU nano to edit files on Linux
- 6 best code editor apps for Mac
- Nano memory card memory card, solution for smartphones not equipped with memory card slot
- Review the LG UltraGear Curved QHD Nano IPS 34 inch
- Download Photo! Editor 1.1: Multifunctional photo editor
- What is nano curcumin? What is curcumin in turmeric?
- Top 5 best Nano water purifiers for tap water, drilled wells
- How to edit configuration files in Ubuntu
- Should I buy RO water purifier or Nano water purifier?
- Block access to Registry Editor on Windows 10/8/7
- The nano 'drill' rotates at a rate of 2-3 million revolutions per second, breaking down cancer cells in just 1 minute
Maybe you are interested
Why should you not buy an iPad Pro with nano texture glass?
Seizing Opportunities: Bitcoin and Nano Investments
Should I choose NanoCell or OLED TV technology?
How to install and use GNU nano to edit files on Linux
Is Vim or nano the best Terminal editor?
Review the LG UltraGear Curved QHD Nano IPS 34 inch