How to delete a directory and its contents
$ rm -rf [directory_name]
- Command
- rm
- Description
- Deletes a directory and all its contents (files and subdirectories) recursively and forcibly. Usage: rm -rf [directory].
- Deep Dive
- This is a dangerous command. Deleted items are not moved to a trash bin and cannot be easily recovered. Flags: -r: Recursive -f: Force (ignore non-existent files and never prompt)
- Related
- How to delete an empty directory