L
L
lgick2014-05-11 16:27:10
vim
lgick, 2014-05-11 16:27:10

Search in VIM (grep and find). Search the entire project, except for folders

I need to go through all the files in the current folder, except for the files in folder1 and folder2, and find the word 'word' in them.
How can I do this?
Why doesn't it work? How to find "everything except ..." in find?

:grep 'word' `find . ! \( -name '*folder1*' -o -name "*folder2*" -a -type d \)`

Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MintTea, 2014-05-11
@lgick

:grep -r "word" . --exclude-dir={folder1,folder2}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question