Nano Text Editor is a command line utility to create information. It was the primary launch in 1999 to exchange the older Pico Editor. To make it obtainable for everybody, Nano was revealed beneath a free & open supply license, therefore extensively utilized in each Unix and Linux-based techniques.
Like VIM, Nano can also be a light-weight textual content editor however provides a user-friendly interface, in order that even learners can simply use it. As there is no such thing as a graphical person interface, Nano is an efficient possibility to make use of not solely on Desktop however even on Linux servers the place CLI is used to edit scripts, configuration information, and different obtainable text-based information.
The minimalistic interface of Nano shows solely crucial info, such because the filename, line quantity, and cursor place. This makes it simple to navigate by way of textual content information and edit them shortly.
Furthermore, working Nano can also be simple with the assistance of assorted keyboard shortcuts. For instance, to save lots of the file after enhancing person can use the Ctrl+O shortcut; in the same method Ctrl+X can be utilized to exit the editor; whereas to chop the present line use Ctrl+Okay and Ctrl+U to uncut the beforehand reduce line.
Apart from fundamental enhancing it additionally helps superior options like syntax highlighting, auto-indentation, common expression search and exchange a number of buffers, and macros. These options make it a robust instrument for enhancing and manipulating textual content information.
Let’s see the steps to install the Nano Text editor on Almalinux or Rocky Linux 9 and eight.
1. Update your Linux
Go to your command terminal of Rocky or Almalinux and run the system replace command. It will apply the newest obtainable system updates on our Linux in addition to rebuild the repo cache of DNF.
sudo dnf replace -y
2. Installing Nano on Almalinux or Rocky
For downloading and putting in the Nano textual content editor, we don’t want so as to add any extra repository as a result of it’s a common command bundle that’s obtainable to install by way of the system’s default repository on many of the Linux distros.
sudo dnf install nano -y

3. Open Nano Linux textual content Editor
To use the put in nano editor you’ll be able to both create a brand new file so as to add the content material you need or edit the present file in your Linux system.
Simply in your Terminal kind – nano adopted by the title of the file you wish to edit. For instance, to edit a file referred to as demo.txt, you’ll kind:
nano demo.txt
In the identical method, if you wish to create a brand new file, kind nano after which the title of the file you wish to create. Example:
nano newfilename
To save your modifications and exit Nano Editor, press Ctrl+X, then Y, after which Enter key.
4. Important instructions or shortcuts to make use of Text Editor
If you aren’t aware of Nano already then listed here are some instructions to make use of as soon as this Text editor is put in in your AlmaLinux or Rocky Linux.
Opening a File:
To open any current file utilizing the nano on Almalinux or Rocky, right here is the command.
nano filename
Saving a File:
After enhancing or creating any file we are able to use a keyboard shortcut given beneath to save lots of the file with modifications however with out closing it.
Ctrl + O
Exiting Nano Editor:
Many new customers preserve struggling on the subject of exiting the Nano editor correctly. So, for that you should use:
Ctrl + X
Before exiting the editor, if there are unsaved modifications the identical can be prompted by the Nano to save lots of earlier than exiting.
Moving Cursor:
To choose the traces on the editor or some explicit textual content we are able to transfer the cursor utilizing arrow keys or mouse
Editing Text:
Unlike the VIM editor, we don’t have to press the INSERT button so as to add some textual content to the file like all conventional GUI Linux textual content editor you’ll be able to instantly kind or delete textual content from it.
Copying and Pasting Text in Nano Editor:
- Alt + A for marking the textual content to be copied. You also can use the Shift+arrow keys to pick out the Text.
- Alt+6 to repeat marked or chosen textual content on the Nano editor.
- Ctrl + Okay for slicing the marked textual content.
- Ctrl + U for pasting the reduce textual content.
Undo and Redo Nano editor textual content:
- Alt+U for undoing the final change.
- Alt + R for redoing the final change.
Searching and Replacing:
- Ctrl + W for looking for a particular textual content within the file on Nano editor.
- Ctrl + R for changing a particular textual content within the file.
Help:
- Ctrl + G for displaying the Nano Editor assist web page with an inventory of instructions.
Exiting with Saving or Discarding Changes:
- Ctrl + X to exit, adopted by Y to save lots of modifications or N to discard modifications.
These are among the fundamental instructions you should use in Nano Editor on Linux. It has many different superior options, reminiscent of Indent marked areas, syntax highlighting, turning seen whitespace on/off, refreshing the display, begin/cease recording of macro, and extra which one can be taught from the Nano Editor’s official documentation web page or utilizing the assistance web page throughout the editor.
Other Articles:
Comments