How to remove all files with a certain extension

Anton Yuzhaninov citrin at citrin.ru
Mon Apr 6 14:10:04 PDT 2009


On Mon, 6 Apr 2009 16:57:39 -0400, John Almberg wrote:
JA> This is a real newbie question, but I can't figure it out...
JA> 
JA> I want to remove all .tar files from a directory tree. I think  
JA> something like the following should work, but I must have something  
JA> wrong, because it doesn't:
JA> 
JA> find . -name *.tar -exec rm /dev/null {} \;

find . -type f -name '*.tar' -delete

-- 
 Anton Yuzhaninov



More information about the freebsd-questions mailing list