How do you use Nano in Linux

+ will let you read the help. can do some pretty nice things so you might want to pootle around in there for a bit.

When you see (et al) it means + . In the help pages, means + .

How can I open text files for editing?

This is the default in . Open and file and you're set to start editing:

Note: you won't be able to save unless you have write permissions for that file.

How can I save the file?

will let you save without exiting. Otherwise, + will prompt you if you've made changes. Press when it asks, and to confirm the filename.

How can I quit the editor without saving the changes?

+ , then when it asks if you want to save.

How to edit? I heard that you've to enter some commands to begin editing in vi, is this true for nano too?

As above, no. is simple. It drops you in edit mode as soon as it opens. You can use arrow keys, / and / as in gedit. You cannot use the mouse for moving the cursor position.

Sometimes, if I manage to open a file, the text is unreadable due to its colors. How can I disable these colors?

Colours are loaded through the nanorc framework. These are files that are loaded when nano loads which basically spell out the syntax highlighting. To toggle syntax highlighting, press + . To disable it permanently for certain file types, edit and put a hash mark () before .

In the some files, lines are truncated because those do not fit in the screen. How can I prevent that from happening?

Well I've been trying to find something but the best I could see was enabling soft-line-wrap with the funky key-combination of: + ( + + ). To enable soft line wrapping by default, add the below line to :

More information about this configuration file can be found at .

answered Jul 23 '11 at 9:40

Oli♦Oli

250k100100 gold badges606606 silver badges788788 bronze badges