in reply to Run a script on every file in a directory
if you prefer bash way, keep in mind that there is a limit max command line length or max arguments count.
# 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 {} \;
|
|---|