Skip to Main Content

Linux Terminal

nano

nano is a text editor installed on Linux. One can use nano to open and edit a file. If you would like to create a file and edit its contents, use nano followed by the filename you want to create. In the following example, the folder ExampleFolder is empty. We use nano example.txt, this will create the file example.txt and open the nano text editor at the same time.

Shortcuts/Commands

When using nano, one may notice the commands at the bottom of the text editor.

Shortcuts such as Exit, Write Out and Replace are denoted by the symbol “^” followed by a letter key. In nano “^” corresponds to the Ctrl key. For example, to exit the nano text editor you would press the keys Ctrl + X.

Along with Ctrl commands, Alt commands are used in nano. Shortcuts labeled with “M-” followed by a letter key, correspond to the combination of Alt plus another key.

The following commands are commonly used when operating nano:

Shortcut Description

nano Notation

Keyboard Shortcut

Exit

^X

Ctrl + X

Save As

^O

Ctrl + O

Find and Replace 

^\

Ctrl + \

Save

^S

Ctrl + S

Undo

M-U

Alt + U

Redo

M-E

Alt + E