# Fastest way to delete a folder structure in Linux

> The problem Deleting a huge folder structure is a pain and can take forever. However if you want to take forever divided by 3, you can use rsync. It seems…

- URL: https://graffino.com/til/fastest-way-to-delete-a-folder-structure-in-linux
- Author: Zeno Popovici
- Channel: command-line
- Published: 2024-09-02
- Updated: 2025-09-04

## The problem
Deleting a huge folder structure is a pain and can take forever. However if you want to take forever divided by 3, you can use `rsync`. 

It seems `rsync` is 3 time faster when deleting a huge folder structure than `rm` or `find` because it doesn't read the files before deleting.

## The trick

* Create an empty folder in `/tmp/empty_folder`
* Run the command:


```bash

rsync -aP --delete ./empty_folder/ ./target_folder/


````

Enjoy!
