Nano -c: Continuously display the cursor-position stats. Nano -i: Automatically indent new lines to the same position as the previous line. Nano -k: Toggle cut so that it cuts from the cursor position instead of the whole line. Nano -m: Provides mouse support to the editor. Nano -v: Opens the file as read-only. File Control in nano. Nano index.php Open or create the file “index.php” with nano on command line. Ctrl-o Y Enter Save changes. Ctrl-r Alt-f Open a new file with a new buffer within nano. Alt- Switch to the next file buffer in nano. Alt-Switch to the previous file buffer in nano. Ctrl-x Quit nano. Navigating through file contents in nano. Feb 06, 2019 But Vim isn't the only command line editor that Linux offers. Copy to android. There are several that are popular among one section of Linux users or other. So, with that in mind, here, in this tutorial, we will discuss the basic usage of the Nano editor, as well as some of the features it provides. Nano is a command-line text editor that is often included with Unix-like computing systems such as Raspberry Pi OS or Ubuntu. It is our preferred text-editor when working within the command-line. We use nano within all of our Raspberry Pi projects and Linux guides.
- Related Questions & Answers
- Selected Reading
WebsiteInternetWeb Services
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?
Gnu Nano Commands
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).
Running Nano
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 –
The output should be like this − Good ssd for ps4.
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 – Apk file sharing sites.
Command | Action |
---|---|
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 |
Nano Command Line Editor Linux
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!