# delete (FTP command)

### Overview

The `delete` command deletes a file from a given location on the remote server. No content is loaded into the flow.

## Need to know

Regular expressions are supported when defining files to be removed with the `delete` command.

## 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), three fields should be updated:

| FTP command                | Root                                                                                                                                                                                                                                                                                                                                                                      | Path                                                                                                        |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| FTP command only: `delete` | <p>The root to the directory where the required file is located. You could enter just <code>/</code> and then a full path in the  <code>path</code> field, or you can provide the full path to the file.<br><br>If you are deleting multiple files using a regular expression, enter the entire path here, so the path field only contains your regular expression.  </p> | The filename or regular expression (if you specified the full path as `root`) or the full path to the file. |

## 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/r3nxNVatZ6XHsjsB2u8x" alt=""><figcaption></figcaption></figure></div></td><td><a href="/files/rI8jPerjv9MFfSCvdBbq">/files/rI8jPerjv9MFfSCvdBbq</a></td></tr><tr><td>In this flow, we need to delete all files that start with 'old' in <code>/myfiles/folderB</code> on the remote server:<br><br><img src="/files/0FxU7aJFXQXhmNe3NSGz" 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/gqChXmraOGlOseFbGbRt" alt=""><figcaption></figcaption></figure></div><ul><li>Look for files from the <code>root</code>, which is defined as: <code>/myfiles/folderB</code></li><li>Check the <code>path</code> for the file(s) to remove, defined as: <code>/^old.*/i</code></li><li>Delete files with the <code>ftp command</code>. This is defined as: <code>delete</code></li></ul></td><td><a href="/files/oMb9sRQ3X0NcUlY4i8Mk">/files/oMb9sRQ3X0NcUlY4i8Mk</a></td></tr><tr><td><p>On our remote server, all files starting with 'old' have been removed from <code>/myfiles/folderB/</code>:<br><br><img src="/files/FcNS6ALYs3FZQiRZhFNF" 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/delete-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.
