Nano Text Editor Cheatsheet
2 min readMar 4, 2023
Main commands for Nano:
Good site to go further: https://www.nano-editor.org/dist/latest/cheatsheet.html
The basics
- ctrl + O : save as
- ctrl + S : save
- ctrl + X : exit
- ctrl + G : help
- alt + U : undo action
- alt + E : redo action
- alt + Del : delete current line
Search
- ctrl + W : find the word you want (forward). type alt + W to go to the next word
- ctrl + Q : find the word you want (backward). type alt + Q to go to the previous word
- alt + R : find and replace
Copy / pasting
- ctrl + K : cut the line or the selected section
- alt + 6 : copy the selected section
- ctrl + U : paste
Move around
- ctrl + _ : start at the line + column you want to
- ctrl + C : display the current line and column number
- cltr + A and ctrl + E: go to the beginning of line/end of the line
- ctrl + arrow up or down: move by block
View
- nano file.txt -v : means view only, so you can’t modify the file
- alt + 3 : comment / uncomment the line. Default #
- alt + N : turn line number on or off
- alt + P : turn visible white space on and off
- alt + O : convert tabs to space on or off
Multiline selection
- shift + arrow keys or alt + A