> ## 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

<a id="sql-kifs-drop-dir" />

Removes an existing [KiFS directory](/content/tools/kifs_api#kifs-directory).

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

## Parameters

<AccordionGroup>
  <Accordion title="<directory name>" id="<directory-name>" defaultOpen>
    Name of the *directory* to remove.
  </Accordion>

  <Accordion title="IF EXISTS" id="if-exists" defaultOpen>
    Optional error-suppression clause; if specified, no error will be returned if the given
    *directory* does not exist.
  </Accordion>

  <Accordion title="WITH OPTIONS" id="with-options" defaultOpen>
    Optional indicator that a comma-delimited list of option/value assignments will follow.

    <div>
      <table class="table w-full [&_td]:min-w-[150px] [&_th]:text-left [&_td[data-numeric]]:tabular-nums">
        <thead>
          <tr>
            <th>Option</th>
            <th>Description</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td><code>recursive</code></td>
            <td>Whether to delete all files contained within the *directory*: <ul><li><code>false</code> *(default)* - only drop the *directory* if empty; return an error if the *directory* contains *files*</li><li><code>true</code> - drop the *directory* and all *files* in it</li></ul></td>
          </tr>
        </tbody>
      </table>
    </div>
  </Accordion>
</AccordionGroup>

## 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.