Grep – Exclude multiple directories and files while using grep search

Thursday, 14. June 2012

Here is a good example of how to list files matching a certain pattern while exclude grep from performing search on multiple folders and files

Files Matching search term excluding multiple directories and files with grep

 
grep 'open source' -R . -il --exclude-dir={var,js,downloader,media} --exclude=*.{png,jpg,gif} --color

Leave a Reply

You must be logged in to post a comment.