Removal script

Yasuhiro KIMURA yasu at utahime.org
Sat Feb 15 13:41:43 UTC 2020


From: Jos Chrispijn <bsduser at cloudzeeland.nl>
Subject: Removal script
Date: Sat, 15 Feb 2020 14:31:59 +0100

> I am looking for a way to remove a nested subdirectory in a directory.
> 
> Example:
> directory /mysources has a certain number of subdirectories which
> contain subdirectory 'nonsense' in various subdirectories, which
> contain also subdirectory 'nonsense', etc.
> 
> What I would like to do is that the script removes all 'nonsense'
> folders in the base /mysources.
> Can you pls tell me how I can do that savest? Thanks!

Does 'nonsence' have subdirecties and should they also be removed? If
answer is yes, try

find /mysources -type -d -name nonsense -exec rm -rf {} +

---
Yasuhiro KIMURA


More information about the freebsd-questions mailing list