# Recursive delete directories in file browser?

**URL:** <https://discourse.jupyter.org/t/recursive-delete-directories-in-file-browser/27468>\
**Category:** JupyterLab\
**Created:** [August 7, 2024, 8:23pm UTC](https://discourse.jupyter.org/t/recursive-delete-directories-in-file-browser/27468 "2024-08-07T20:23:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cboettig](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/cboettig/32/1662_2.png) [@cboettig](https://discourse.jupyter.org/u/cboettig)\
**Post date:** [August 7, 2024, 8:23pm UTC](https://discourse.jupyter.org/t/recursive-delete-directories-in-file-browser/27468/1 "2024-08-07T20:23:23Z")

</div>

Is there a way to enable recursive deletion of a directory in the file browser? Currently, if a user clicks delete on a non-empty folder, they get an error that the folder is not empty.

Yes, I know this matches the behavior of command-line shell tools like `rm` or `rmdir`, but I have yet to see another GUI interface that presents users with this same design. Is it possible to change this behavior? I’d very much love to be able to teach my students from JupyterLab as a first-class environment without suggesting they fall back on code-server, rstudio, or command-line.

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [August 18, 2024, 8:49pm UTC](https://discourse.jupyter.org/t/recursive-delete-directories-in-file-browser/27468/2 "2024-08-18T20:49:39Z")

</div>

I recall that this behaviour varies between file systems (and thus is different by default on Windows as compared to Linux). I think setting `FileContentsManager.always_delete_dir` to true in jupyter-server configuration might help you, but there are caveats. See [Config file and command line options — Jupyter Server documentation](https://jupyter-server.readthedocs.io/en/latest/other/full-config.html)

---

<div class="post-metadata">

**Author:** ![cboettig](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/cboettig/32/1662_2.png) [@cboettig](https://discourse.jupyter.org/u/cboettig)\
**Post date:** [August 23, 2024, 2:00am UTC](https://discourse.jupyter.org/t/recursive-delete-directories-in-file-browser/27468/3 "2024-08-23T02:00:58Z")

</div>

thanks so much, this worked perfectly.

For reference, for my k8s setup I had to put this in singleuser section of values.yaml

```auto
singleuser:
   extraFiles:
     jupyter_server_config.json:
         mountPath: /usr/local/etc/jupyter/jupyter_server_config.json
         data:
            ContentsManager:
              allow_hidden: true
            FileContentsManager:
              always_delete_dir: true

```
