# files only in current directory (also hidden) find . -type f -maxdepth 2 -print0 | xargs -0 script.pl # all files in all subdirectories find . -type f -print0 | xargs -0 script.pl # or run script for every file find . -type f -exec script.pl {} \;