when in home directory and type
locate *.cpp I get hundreds of results.
using the same command in (for example) ~/../forfun/netstream/ gets me a dozen results.
how's that 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