The following article explains how to edit a file using Nano. This first requires you to establish an SSH connection to your server.

Nano uses keystroke combinations to execute certain functions. The keystrokes consist of first pressing and holding the control key and then pressing an additional key. The following are common functions:

  • CTRL+o: this will save the file
  • CTRL+x: this will exit the file
  • CTRL+w: this will allow you to enter a phrase to search the file
  • CTRL+k: this will allow you to cut 1 or more lines of text
  • CTRL+u: this will allow you to uncut lines of text that were cut using CTRL k (similar to pasting text)
  • CTRL+v: this will advance the file to the next page
  • CTRL+y: this will move the file to the previous page
  • CTRL+t: this will run spellcheck on the file

To create a new file using Nano, please follow these steps:

  1. Open Nano by typing the following:
    nano
  2. Enter the information to wish to put in the file.
  3. Save the file (keystroke listed above).
  4. Enter the name of the file.
  5. Press Enter.

To edit an existing file using Nano, please follow these steps:

  1. Open Nano by typing the following:
    nano filename
  2. Edit the information in the file.
  3. Save the file (keystroke listed above).
  4. Press Enter to save the file with the same name.
Bài viết này có hữu ích với Bạn? 12 Người xem đã đánh giá bài viết này hữu ích (211 Điểm)