Nano Text Editor
Nano is a simple, beginner-friendly text editor that lives right inside your terminal. Unlike more complex editors like Vim or Emacs, Nano is very easy to use from day one.
Opening Nano
To create or open a file with Nano, just type nano followed by the filename.
Bash
nano my_file.txt
Key Operations
In Nano, the ^ symbol stands for the Ctrl key. Look at the bottom of your screen in Nano for these shortcuts:
- Ctrl + O (Write Out): Save the changes you've made to the file.
- Ctrl + X (Exit): Close Nano. If you have unsaved changes, it will ask if you want to save them first.
- Ctrl + W (Where Is): Search for a specific word or phrase in the text.
- Ctrl + K (Cut Text): Delete (cut) the current line.
- Ctrl + U (Uncut Text): Paste the line you just cut.
Editing Process
- Open the file: nano hello.txt
- Type your message.
- Press Ctrl + O and then Enter to save.
- Press Ctrl + X to exit and go back to the terminal.
Note: While you are in Nano, you can't use your mouse to click on lines or menus. You must use the arrow keys to move your cursor around.