nano
nano
is a simple text editor for unix systems, with a much smaller learning curve than vi and emacs. It is great for people who are new to the command line, and need to quickly make small changes to files.
$ nano filename
nano
comes pre-installed on most linux distributions. If your distribution does not contain nano
, you can easily install it with apt
.
$ apt-get install nano
Why nano?
nano
is perfect for people who need to change files on the command line, but don’t have the time (or patience) to learn the ins and outs of vim/emacs. If you often use an external editor for programming but occasionally need to make changes to config files on a remote server, nano
is your best friend.
In nano
, common keyboard shortcuts are displayed at the bottom of the screen. No more forgetting how to save and close, or googling how to search for a keyword - nano
has your back!
Command Reference
nano
has the benefit of being very beginner-friendly as well as maintaining some powerful features from other editors. Here are some useful commands that are not listed on the main screen.
Ctrl+^
akaCtrl+6
- Set mark for cut/copy (use arrow keys to extend/retract mark)Alt+^
akaAlt+6
- Copy textAlt+U
- UndoAlt+E
- RedoAlt+\
- Go to beginning of fileAlt+/
- Go to end of fileAlt+(
akaAlt+9
- Go to beginning of paragraphAlt+)
akaAlt+0
- Go to end of paragraphAlt+-
- Scroll up one line without moving cursorAlt+=
- Scroll down one line without moving cursorAlt+$
- Enable/disable soft wrapping for long lines