Find and delete files that contain a specified string
- Run in Terminal
go run .
-
Enter a path to the folder you want to search and delete files in.
As a shortcut, you can drag a drop the folder from Finder into Terminal. -
Enter a string. Filenames that contain that string will be deleted.
-
Choose to permanently delete files by pressing "y". (Deleted filenames will be logged in a text file.) Pressing "n" will move files to a new folder.