Nano editor: Tips and commands!
08/11/2019 (1627x read)
The nano Editor is a small and popular text editor for Linux and the Raspberry Pi. It is usually included in the Ubuntu and Debian (+ Raspbian) installations and is a replacement for the vi Editor. To open a file with the nano editor, enter this command in the console:
nano my-file.txt
Or, to have super-user rights, type:
sudo nano my-file.txt
Important Nano commands
CTRL + O: Save file
CTRL + X: Close file
STRG + W: Search (or jump in the file)
CTRL + K: Cut current row
CTRL + U: Paste clipboard contents
CTRL + C: Display cursor position (row / column)
Move in a document and go to end:
Use the arrow keys to move the cursor left, right, up and down. When you reach the last line displayed, the screen scrolls one line forward. Especially with longer documents it takes a very long time to jump to a certain line or position, so there are special commands with which you can scroll up or down an entire screen or jump directly to the beginning or end of the file:
CTRL + A: Jump to the beginning of the current line
CTRL + E: Jump to end of line
CTRL + space: Jump one word forward
CTRL + V: Jump down one screen page
CTRL + Y: Jump up one screen page
CTRL + W: Find a text in the document
CTRL + W, then enter CTRL + V: Jump to end of file
CTRL + W, then enter CTRL + Y: Jump to the beginning of the file