Ubuntu – Locate name doesn’t work

locate

There is a file at /user/share/jogl.jar.

I am using locate jogl.jar

but it doesn't work. Why?

Best Answer

From the man page:

   locate  reads  one or more databases prepared by updatedb(8) and writes
   file names matching at least one of the PATTERNs  to  standard  output,
   one per line.

Run updatedb as root and try again. It should work.

Alternatively you can use find or find | grep, which does not uses a db (and thus is considerably slower).

Related Question