Quantcast
Viewing all articles
Browse latest Browse all 103

How to delete a list of files and folder generated via find in terminal?

I’m generating a list of files and folder that meet certain criteria with use of a command:

find ~/ -iname "whatIwantToRemove"

The command will generate some results:

/Users/me//.Trash/whatIwantToRemove
...

I would like to be able to automatically delete all of those files.


Possible solution

I’m looking at a similar discussion on Unix and Linux and was wondering whether the command would work:

find . -type f -regex '/ex/' -exec rm {} ;

Viewing all articles
Browse latest Browse all 103

Trending Articles