Grep exclude directory

In this article let’s discuss about Grep exclude directory. Let’s go through the following methods without any delay.

Method 1:

grep -rli --exclude-dir={dir1,dir2,dir3} keyword /path/to/search

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar but have a try!

Method 2 :

grep -rli --exclude-dir=/path/to/exclude "keyword"

Hope the above solution works.

Realted Posts : Tailwind vite