# list (FTP command)

### Overview

The `list` command lists files in a given directory. The listing is loaded into the flow as a payload (where each filename is listed in an array).  &#x20;

## Need to know

Regular expressions are not supported for the `list` command - it should only be used to list all files in a given directory. If you need to work with a specific group of files, you may find the [get](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape/configuring-sftp-connections/valid-ftp-commands/get-ftp-command.md) command useful.

## Connection settings

When [configuring an SFTP connector](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape/configuring-sftp-connections.md), two fields should be updated:

| FTP command              | Root                                                                                                                                                      | Path          |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| FTP command only: `list` | <p>The root to the directory you want to list.<br><br>Since there is no specific file to consider, the full path to the directory will be the root.  </p> | Not required. |

## Example

* [Scenario](#scenario)
* [The steps](#the-steps)

### Scenario

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><p>Our process flow is configured as follows:</p><div><figure><img src="/files/VhqQ8VwgKjHCppRdPFwn" alt=""><figcaption></figcaption></figure></div></td><td><a href="/files/rI8jPerjv9MFfSCvdBbq">/files/rI8jPerjv9MFfSCvdBbq</a></td></tr><tr><td>In this flow, we need to list all files in <code>/myfiles/folderB</code> on the remote server:<br><br><img src="/files/GC00ijtgLvdw7fcSl8pU" alt=""></td><td><a href="/files/2vpVY6Q37YrYqTgeZirK">/files/2vpVY6Q37YrYqTgeZirK</a></td></tr></tbody></table>

### The steps

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><p><strong>Connector settings</strong></p><p>Our SFTP shape is configured as follows: </p><div align="left"><figure><img src="/files/BuHGcIEH2VOfTPTQj8Pn" alt=""><figcaption></figcaption></figure></div><ul><li>List all files in the <code>root</code>, which is defined as: <code>/myfiles/folderB/</code></li></ul></td><td><a href="/files/oMb9sRQ3X0NcUlY4i8Mk">/files/oMb9sRQ3X0NcUlY4i8Mk</a></td></tr><tr><td><p>On our remote server, all files in <code>/myfiles/folderB/</code> are loaded into the flow as a payload, with files in an array:<br><br><img src="/files/yra3dq5yjsgHej5t13TO" alt=""></p><p></p></td><td><a href="/files/J6YFhcQQMgUmK2sBQwdu">/files/J6YFhcQQMgUmK2sBQwdu</a></td></tr></tbody></table>


---

# 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://doc.wearepatchworks.com/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape/configuring-sftp-connections/valid-ftp-commands/list-ftp-command.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.
