When I'm in my home directory and type
locate *.cpp I get hundreds of results.
Using the same command in (for example)
~/../forfun/netstream/, I see only a few results.
How is this possible?
If you run
So if there are any .cpp files in your current directory
if you don't want the shell to try to expand the pattern.
Alternatively if you're happy with the output of locate but just want to trim it down, you can always pipe it through