Delete a directory with all its contents
delete folder with contents | remove directory recursively | delete a non-empty directory | linux rm -rf folder | rm | delete | directoryWarning, destructive. This command deletes, overwrites or changes data in a way that cannot easily be undone. Check every placeholder carefully and make a backup first.
rm -rI -- /var/www/vhosts/example.com/httpdocs/oldDeletes the directory recursively with everything inside. With recursive deletion, -I asks exactly once instead of for every file like -i. It is the safer variant of the notorious rm -rf.
Note: Check the path with ls first. A misplaced space or an empty variable can hit completely different directories.
Also searched as
- delete folder with contents
- remove directory recursively
- delete a non-empty directory
- linux rm -rf folder