How to find and delete directory recursively on Linux/Unix - nixCraft
https://www.cyberciti.biz/faq/how-to-find-and-delete-directory-recursively-on-linux-or-unix-like-system/
Find Command Syntax to Delete Directory RecursivelyFinding and Deleting Directory Recursively Using xargsShell Script to Recursively Remove Backups Older Than 30 DaysConclusionThe syntax is as follows to find and delete directories on Linux/Unix system. For example, delete all empty directories: $ find /path/to/dir/ -type d -empty -print0 | xargs -0 -I {} /bin/rm -rf "{}" In this example, remove all foo directories including sub-diretories in /backups/ folder: $ find /backups/ -type d -name "foo*" -print0 | xargs -0 -I {...See more on cyberciti.bizReviews: 11Difficulty level: EasyCategory: File ManagementRequirements: Linux or Unix terminalExplore further The syntax is as follows to find and delete directories on Linux/Unix system. For example, delete all empty directories: $ find /path/to/dir/ -type d -empty -print0 | xargs -0 -I {} /bin/rm -rf "{}" In this example, remove all foo directories including sub-diretories in /backups/ folder: $ find /backups/ -type d -name "foo*" -print0 | xargs -0 -I {... Reviews: 11 Difficulty level: Easy Category: File Management Requirements: Linux or Unix terminal
The syntax is as follows to find and delete directories on Linux/Unix system. For example, delete all empty directories: $ find /path/to/dir/ -type d -empty -print0 | xargs -0 -I {} /bin/rm -rf "{}" In this example, remove all foo directories including sub-diretories in /backups/ folder: $ find /backups/ -type d -name "foo*" -print0 | xargs -0 -I {...
Reviews: 11
Difficulty level: Easy
Category: File Management
Requirements: Linux or Unix terminal
DA: 44 PA: 12 MOZ Rank: 48