Home Download Ubuntu

Installing and using terminal editor Nano in Ubuntu

ubuntu nano editor

To install the Nano editor:

sudo apt-get install nano



Editing or making a new file has the same command from terminal, because if it doesn't find a file, is creating it:

sudo nano the_file_we_want


Using keyboard:

CTRL+R - opens a file with the read file command. The Read File command inserts a file from disk at the current cursor location.
CTRL+O - Save and Save As are both accomplished with the Write Out command. When prompted, press enter to accept the existing file name. To save as another file name, type in the new name and press Enter, or use the Ctrl-T key combination to use nano's built-in file browser.
CTRL+X - Closes the file and exits the editor. Type y to save the file, or n to exit nano without saving the file.
CTRL+K - If no text is marked, it cuts the entire line of text in the "cut buffer".
CTRL+U - pastes the text in the "cut buffer" into the file.
ALT+A - is to select a text. Move your cursor at the start of the text you want to select, press the Alt-A and move cursor to the end of the section you want to select.

Resources: Nano Editor

5 comments:

I,Writer said...

Thanks! This helped me!

Matus z Kypaxa said...

sudo update-alternatives --config editor
Allow you to choose DEFAULT EDITOR in your Ubuntu

Unknown said...

Thanks

Tuan Le said...

Thank you for sharing,can you please have a look please,don't know why I get this messages: [root@server ~]# sudo apt-get install nano
sudo: apt-get: command not found

Speedy Gonzales said...

@Tuan Le: you are probably not using Ubuntu. find out your linux distribution by running "cat /proc/version"

Post a Comment