# Unix Shell Manual Pages

Unix comes with a preloaded documentation, also known as "man pages".

## Anatomy of a man page

Each page is a self-contained document consisting of the following sections:

* NAME: the name and a brief description of the command.
* SYNOPSIS: how to use the command, including a listing of the various options and arguments you can use with the command. Square brackets (\[ ]) are often used to indicate optional arguments. Any arguments or options that are not in square brackets are required.
* DESCRIPTION: a more detailed description of the command including descriptions of each option.
* SEE ALSO: References to other man pages that may be helpful in understanding how to use the command in question.

## Search for man pages

When you are not sure of the exact name of a command, you can use the apropos command to see all the commands with the given keyword on their man page.

```bash
apropos keyword 
```

For example, to see which commands are relevant to the task of copying, type the following:

```bash
apropos copy
```

## View man pages

To view a manual page, use the command man.

```bash
man command_name
```

When viewing a man page, use the following keys to navigate the pages:

* spacebar- view the next screen;
* b (for "back") - view the previous screen;
* arrow keys - navigate within the pages;
* q (for "quit") - quit and return to the shell prompt.

For example, to view the man page associated with the command `cp`, type the following:

```bash
man cp
```


---

# 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/the-unix-shell/unix-shell-manual-pages.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.
