> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DROP DIRECTORY

Removes an existing [KiFS directory](https://docs.kinetica.com/content/tools/kifs_api.md#kifs-directory).

```sql title="DROP DIRECTORY Syntax" theme={null}
DROP DIRECTORY [IF EXISTS] '<directory name>'
[WITH OPTIONS ('<option name>' = '<option value>'[,...])]
```

## Parameters

> [accordion] \<directory name>
>
> Name of the *directory* to remove.

> [accordion] IF EXISTS
>
> Optional error-suppression clause; if specified, no error will be returned if the given
> *directory* does not exist.

> [accordion] WITH OPTIONS
>
> Optional indicator that a comma-delimited list of option/value assignments will follow.
>
> <table>
>   <thead>
>     <tr>
>       <th>Option</th>
>       <th>Description</th>
>     </tr>
>   </thead>
>
>   <tbody>
>     <tr>
>       <td>`recursive`</td>
>       <td>Whether to delete all files contained within the *directory*: <ul><li>`false` *(default)* - only drop the *directory* if empty; return an error if the *directory* contains *files*</li><li>`true` - drop the *directory* and all *files* in it</li></ul></td>
>     </tr>
>   </tbody>
> </table>

## Examples

To delete a *directory*, `kbackup`:

```sql DROP DIRECTORY Example theme={null}
DROP DIRECTORY 'kbackup'
```

To delete a *directory*, `kdata`, and all files in it, suppressing the error
if it doesn't exist:

```sql DROP DIRECTORY with Files Example theme={null}
DROP DIRECTORY IF EXISTS 'kdata'
WITH OPTIONS ('recursive' = 'true')
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.