Nano Editor
GNU nano is a user-friendly command line shell text editor for Unix and Linux operating systems. It includes all the basic functionality of a text editor, such as "text content create/update, search and replace with regular expression support, spell checking, and more" (Linuxize 2021).
Basic Operations
Open
Open a file on the command line by using the nano
command followed by the file name.
nano hello.txt
Creating a New File
Same as opening a file, but the file does not exist yet.
Saving a File
To save a file, press Ctrl+O
and then press Enter
to confirm the file name.
Use Ctrl+X
to exit the editor.
Search and Replace
To search text, enter Ctrl+W
and then enter the text to search for.
After entering search mode, using Alt+W
will search for the next occurrence of the text.