#!/usr/bin/perl use warnings; use File::Find; #takes list of dirs on commandline #must give one or get an error finddepth sub { return if $_ eq "." or $_ eq ".."; return if -d; unlink($_); # print "$File::Find::name\n"; #if you want printout }, @ARGV; __END__ #### find . -type f -exec rm {} \; #### $ time find . -type f -exec rm {} \; real 0m2.987s user 0m0.785s sys 0m2.184s $ time ./zdelfiles Gtk3 real 0m0.384s user 0m0.076s sys 0m0.308s