Recursively delete files using wildcards in FreeBSD

Syntax of the find command:

find (path) -name “wildcard expression in quotes” -(optional find expression)

 

The path can be a folder like /my/folder/is/here or the current folder .

By default find will recurse through all the files and folder from the specified path.

You can provide an option expression at the end prefixed with a hyphen. For example to delete all *.core dump files in /var the command would be

find /var -name “*.core” -delete

To find all the available expressions in Find. look here

 

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.