Useful nano Commands

When working in a shell, my preferred text editor is nano. It’s easy to find the full manual online, but I wanted to share some of my frequently used commands:

Create / edit file named XXXXX
nano XXXXX

Exit nano
Control + x
Followed by:
Y to close saving changes
N to close without saving changes
Control + C to cancel exit

Find within file
Control + w

When in find mode, switch to replace mode
Control + r

When in replace mode, after typing the text to replace
Control + x to toggle between replace one and replace all
Enter to confirm replacement
Followed by Y to confirm each instance

Scroll to Top