Issue
I've read
Use grep --exclude/--include syntax to not grep through certain files
but in my CentOS6.4, when I do
grep --exclude=*.cmd ckim * -r
I see lots of grepped lines from *.cmd files.
so it seems the exclude option is not working for me.
What is wrong?
of course I can do things like
grep ckim \`find . -name \*.c -print\`
but I want to know why the grep doesn't work.
Solution
You can quote the pattern:
grep -r --exclude="*.cmd" "ckim" ./
PS. ./
is the current directory
Answered By - Tiago Lopo Answer Checked By - David Goodson (WPSolving Volunteer)