- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Use Nano Text Editor
Are you confused by all of the other text editors? then, this article is for you! Linux amateurs are often put off by other advanced text editors such as Vim and Emacs. While they are decent programs, they does require a bit of learning curve. Nano offers a perfect solution if you are looking for a small and friendly text editor. It offers many useful and productive features.
What is Nano Text Editor?
Nano is a text editor for Unix-like systems or any other environments using a command line interface. It emulates the Pico text editor, a part of the Pine email client, which also provides additional functionality. In contrast to Pico, Nano is licensed under the GNU General Public License (GPL).
Nano follows the path and opens the file if it exists. However, If it does not exist, it’ll start a new buffer with that filename in a directory. To run Nano Text editor, use the following command –
To run Nano Text editor, use the following command –
$ nano text_files/testfile
The output should be like this −
Shortcuts of Nano Text Editor
Nano text editor “commands” are commonly referred to as “shortcuts” such as read file, save file, close file etc. The most common commands are placed at the bottom of the screen, but there are many more. Note that, nano text editor does not use the Shiftkey. All shortcuts use lowercase letters and unmodified number keys.
To see a list of valid shortcuts hitCtrl+G (in your Keyboard), the output should be like this –
When you’re done looking at shortcuts, hit theCTRL+X to exit the help window.
Suppose, if you’re working on a new text file and you want to save it, then call it as “writing out”(Ctrl+O). The output window should be like this –
- To move the cursor forward or backward, you can hit Ctrl+F andCtrl+B respectively.
- To move up and down one line at a time, then you can hit Ctrl+P andCtrl+N. In other words, you can use Right, Left, Up, and Down arrow keys (in your keyboard) respectively.
- If you want to mark any text hit CTRL+^ shortcut key.
The output window should be like this-
In the above image, we have marked “their drawing rooms.”
- To cut the marked text hitCtrl+K shortcut.
- If you want to paste your marked text, hitCtrl+U shortcut.
Frequently Used Shortcuts
The below are a list of shortcuts which can ease your work –
|CTRL + A||Move to beginning of line|
|CTRL + E||Move to end of line|
|CTRL + Y||Move down a page|
|CTRL + V||Move up a page|
|CTRL + _||Move to a specific line|
|CTRL + C||Find out what line the cursor is currently on|
|CTRL + V||Move up a page|
|CTRL + W||Search for some text|
|CTRL + D||Delete the character currently under the cursor|
|CTRL + K||Delete entire line|
|CTRL + \||Replace a string of character|
|CTRL + O||Save the content without exiting|
|CTRL + T||When saving a file opens a browser that allows you to select a file name from a list of files and directories|
Congratulations! Hope you perfect these basics of Nano text editor. In our next articles, we will come up with more such Linux based tricks and tips. Keep reading!
Kickstart Your Career
Get certified by completing the courseGet Started