Find command exclude files whose path match a certain pattern
- by user40570
I have a find command that looks for files that was modified recently and outputs the date
find /path/on/server -mtime -1 -name '*.js' -exec ls -l {} \;
I would like it to exclude any deeply nested folder that matches a certain pattern e.g. there are a number of folders that have a "statistics" directory and ".svn" directories. So i'd like to be able to say if the file that was modified yesterday is in a folder named statistics ignore it. Or perhaps not search for files in those folders at all.