I am trying
grep -rn '*.cpp' -e 'aPattern'
to find the pattern aPattern
recursively in a directory withing cpp files
but I got
*.cpp no such file or directory
why is this failing? there are cpp files in the subdirectories
I am trying
grep -rn '*.cpp' -e 'aPattern'
to find the pattern aPattern
recursively in a directory withing cpp files
but I got
*.cpp no such file or directory
why is this failing? there are cpp files in the subdirectories
found a solution
grep -rn --include '*.hpp' -e 'aPattern'
the key is to put --include
even better
grep --color -rn --include '*.hpp' -e 'aPattern'