Thursday, February 14, 2013

How to selectively delete files from a folder and all of its subfolders using find command in Unix

If you need to selectively delete specific files from a folder also including files in all of its subfolders use find command.
For example, this command will delete all files with a name that start with "isoforms" in a current folder and all of the subfolders of the current folder:
find . -name "isoforms*" -type f -exec rm -v {} \;

1 comment: