> For the complete documentation index, see [llms.txt](https://doc.wearepatchworks.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](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).

# 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><p><img src="/files/r3nxNVatZ6XHsjsB2u8x" alt="" data-size="original"></p></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><p><img src="/files/gqChXmraOGlOseFbGbRt" alt="" data-size="original"></p><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>On our remote server, all files starting with 'old' have been removed from <code>/myfiles/folderB/</code>:<br><br><img src="/files/FcNS6ALYs3FZQiRZhFNF" alt=""></td><td><a href="/files/J6YFhcQQMgUmK2sBQwdu">/files/J6YFhcQQMgUmK2sBQwdu</a></td></tr></tbody></table>
