Asked • 05/28/19

How to exclude a directory in find . command?

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 file in $(find . -name '*.js') do java -jar config/yuicompressor-2.4.2.jar --type js $file -o $file done

2 Answers By Expert Tutors


Eli C. answered • 11/20/19

New to Wyzant

Software Engineering Professional With Many Years of Experience

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.


Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.