Thorn Tech Marketing Ad
Skip to main content
Version: 1.1.1

Using the nano Text Editor

Overview

The nano text editor is a user-friendly, terminal-based text editor pre-installed on most Linux distributions, including those used in SFTP Gateway environments. Unlike vim, which has a steeper learning curve, nano offers straightforward commands, making it ideal for users who need to edit files without extensive training.

Creating and Editing Files with Nano

  1. Navigate to Your Desired Directory
cd /path/to/your/directory

Tip: Running cd without a specified path will take you to your home directory

  1. Create a New File or Open an Existing One:
nano test.txt

Replace test.txt with your desired file name. If the file doesn't exist, nano will create it upon saving.

You can verify that the file exists by using:

ll

This stands for "long listing", and is a shortcut for ls -la

  1. Editing the File:
  • Entering Text: Simply start typing to add content.
  • Basic Navigation: Use the arrow keys to move the cursor.

You should see something like: azure-nano-1.png

  1. Saving and Exiting:

The bottom helper text will change to this: azure-nano-2.png

Choose Yes by typing the uppercase letter Y.

You should see this screen: azure-nano-3.png

Nano is now prompting you to save your changes to the file test.txt. To accept this value and continue, hit Enter.

You are now at the command prompt again. To verify that your changes took effect, type:

cat test.txt

And you will see the output:

hi this is a test file