Locate: Difference between revisions

From Hackepedia
Jump to navigationJump to search
mNo edit summary
m Updated your locate database: added db locations
Line 15: Line 15:
  # /usr/libexec/locate.updatedb
  # /usr/libexec/locate.updatedb


You can see the database stored at /var/db/locate.database.


On Debian GNU/Linux:
On Debian GNU/Linux:
Line 21: Line 22:


  # /usr/bin/updatedb
  # /usr/bin/updatedb
You can see the database stored in /var/cache/locate/locatedb.


Once you have this database, you can use many tools such as which, whereis and locate.
Once you have this database, you can use many tools such as which, whereis and locate.

Revision as of 15:36, 19 January 2006

Trying to locate a file, if you're lucky you can try

$ locate $file


Updated your locate database

On FreeBSD:

# vi /etc/locate.rc

to see you options. i.e. You might want to add /usr/ports to PRUNEPATH and then:

# /usr/libexec/locate.updatedb

You can see the database stored at /var/db/locate.database.

On Debian GNU/Linux:

--prunepath is one of the many options found in the Manual, then rebuild your database:

# /usr/bin/updatedb

You can see the database stored in /var/cache/locate/locatedb.

Once you have this database, you can use many tools such as which, whereis and locate.

# which bash
/usr/local/bin/bash
# whereis bash
bash: /usr/local/bin/bash /usr/local/man/man1/bash.1.gz /usr/ports/shells/bash
# locate bash
/usr/jail/usr/share/zoneinfo/Africa/Lubumbashi
/usr/local/bin/bash
/usr/local/bin/bash2
/usr/local/bin/bashbug
[snip]