Asked • 06/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

1 Expert Answer

By:

Eli C. answered • 11/20/19

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.

OR

Find an Online Tutor Now

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