looking for a script

Associate
Joined
20 Jul 2005
Posts
216
im looking for a script that will search a directory and its sub-directories to find files within them and to delete those files. any ideas how id go about it?
 
Check the find man page, lets you search a folder and all its sub-directories for files based on a multitude of parameters such as name, size, modified date etc and then run a command against these files such as rm -f

Code:
find . -name foo -exec rm -f {} \;

Would find all files named foo in the current directory and all subdirectories and then remove them without prompting
 
Back
Top Bottom