There are multiple installation of Java on my system, some silently installed by IDEs, and I wanted to find out where they are. So I thought to use locate to find them. My first try oflocate javahad several thousand hits finding .*java.*.Is there a way to restrict the locate to just find files with and exact name? Not path containing Java. Not files who containing Java as part of their name.PS: I had similar problem before so please ignore the Java part and treat this as a problem of finding files. It could just as well be a question of finding all occurrences of gcc.
how to find occurrences of a file using locate
files;locate
From man locate:To search for a file named exactly NAME (not *NAME*), use                locate -b '\NAME'locate -b '\java'-b - Match only the base name against the specified patterns.