NANO commands - a how-to guide

NANO is a tool you can use to modify or create files in SSH. It offers a wide-range of functionality for editing existing files. 

NANO is an editor which you can add or type text into once open. There may be times when you need to turn off line-wrap to ensure there are no formatting issues.

In order to disable wrapping on long text lines type the following command: nano -w /filedirectory/filename

When a file is open in NANO, there are commands which will assist you in finding, editing, or saving content. Below is a list of commands when editing a file with NANO.

To exit: CTRL+x

To save after modification, exit with the above command and enter "y" when prompted.

To cancel any modification, exit with the above command and enter "n" when prompted.

If creating a new file, upon running the above command you will also be prompted for a file name. Enter the desired file name to create the file.

To cut a single line: CTRL+k

To paste a line: CTRL+u

To search for items: CTRL+w

To save without exiting: CTRL+o

Justify current selected paragraph: CTRL+j

Insert a file into the currently selected one: CTRL+r

Move to previous screen: CTRL+y

Move to next screen: CTRL + v

Display cursor: CTRL+c

Invoke spell checker: CTRL+t

For further commands that can be used when utilizing the nano utility, please use the following command to pull up a full list of features.

To pull up nano help page: CTRL+g

 

Was this answer helpful? 0 Users Found This Useful (0 Votes)