Skip to content

How can I exclude a directory and its subdirectories? #2128

Answered by andradei
andradei asked this question in Q&A
Discussion options

You must be logged in to vote

The --follow was conflicting with the exclusion of /proc since that dir isn't really a dir or a file (it is treated differently by Linux).

I ended up running this to exclude /proc and other things (notice that --no-follow makes it work):

rg -g '!{/proc,/sys,**/*.js,**/*.css,/home,**/*.py}' --no-follow firefox /

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mbana
Comment options

Answer selected by andradei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants