# nano

* Nano is freely available under the GPL for Unix and Unix-like systems.
* It is a keyboard-oriented editor, controlled with key combinations, i.e. the "control" key (denoted by "^") PLUS certain letter keys.

### Basic commands:

* ^O : saves the current file
* ^W : goes to the search menu
* ^G : gets the help screen
* ^X : exits

### Basic Usage

* Launch the editor by typing "nano" at the shell prompt. An overview of available commands is given at any time at the bottom of the editor screen.

```
nano
```

<figure><img src="/files/LmlBmJZtGawT1V4KlGH4" alt=""><figcaption></figcaption></figure>

* Open an existing file by typing "nano" followed by the file name.

```
nano file1.txt
```

<figure><img src="/files/V19SM7Sdi3DDG3NVlBus" alt=""><figcaption></figcaption></figure>

* If you modify the file, when you exit you will be asked whether to save the changes and the name of the file to save.

<figure><img src="/files/WMhbkgxmHHKa5sJ665KY" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/3GBi7qwHW9pftbcv1TUS" alt=""><figcaption></figcaption></figure>

### Advanced Usage

#### Find and replace in nano

* While holding down Ctrl key, press \\
* Enter your search string at prompt and press return
* Enter your replacement string at prompt and press return
* Respond to "Replace this instance" option menu:
  * Y to replace current instance
  * N to skip current instance
  * A to replace all instances
* Note: The search string can also be a regular expression.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://igb.mit.edu/mini-courses/introduction-to-unix-and-ki-computational-resources/basic-unix/unix-text-editors/nano.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
