I\'m trying to run a find
command for all JavaScript files, but how do I exclude a specific directory?
Here is the find
code we\'re using.<
For what I needed it worked like this, finding landscape.jpg
in all server starting from root and excluding the search in /var
directory:
find / -maxdepth 1 -type d | grep -v /var | xargs -I '{}' find '{}' -name landscape.jpg
find / -maxdepth 1 -type d
lists all directories in /
grep -v /var
excludes `/var' from the list
xargs -I '{}' find '{}' -name landscape.jpg
execute any command, like find
with each directory/result from list