nano

What is nano?

When working on the command line, quite often you will need to create or edit text files. Two of the most powerful and popular command-line editors are Vi and Emacs. Both of them have a steep learning curve that can be intimidating to new users. For those who need a simple editor, there is nano.

GNU nano is an easy to use command line text editor for Unix and Linux operating systems. It includes all the basic functionality you’d expect from a regular text editor, like syntax highlighting, multiple buffers, search and replace with regular expression support, spellchecking, UTF-8 encoding, and more.

How to use nano

# syntax, OPTIONS = optional 
nano <OPTIONS> <FILE>

##### open a file on a specific line
nano +50 file.txt

##### within nano text editor - search for a file
ctrl + w # then type the search term and press enter

##### within nano text editor - copying, cutting and pasting
ctrl + k # CUT # move with your cursor/shift + arrow key over the point that you want to cut
ctrl + u # PASTE # paste the text that was cutted, or copyed earlier 

##### within nano text editor - copy a selected block
ctrl + 6 # mark will be set, from this point use the arrow keys for the text you want to copy
alt + 6  # with this the marked text will be copyed, from this point you can use ctrl + u to paste the text

##### within nano text editor - delete a selected block
ctrl + 6 # mark will be set, from this point use the arrow keys for the text you want to copy
ctrl + k # CUT # move with your cursor/shift + arrow key over the point that you want to cut (or in this case delete)

##### within nano text editor - save a file
ctrl + o 

##### within nano text editor - leave a file
ctrl + x

Last updated