Locate files and binaries on a system

Author: name contact BSD flavour

Reviewer: name contact BSD flavour

Reviewer: name contact BSD flavour


Concept

Be able to quickly find the location of any file on the system as needed and know which utilities can be used to find binaries, source, manpages and files. In addition, be able to update the locate(1)(((locate))) database.

Introduction

By default, this database is built every Saturday. (See section Configure the scripts that run periodically to perform various system maintenance tasks for details on weekly maintenance tasks.)

TODO: show how to manually build this database

If you want to find a file in real-time, you can use the find command. More information, and examples of using find is covered in section Find a file with a given set of attributes.

SUGGESTION: consider mentioning locate and how to force immediate population of the locate database on a freshly install system without waiting for an overnight cron job

SUGGESTION consider mentioning which as a method to discover locations of installed applications; this is especially useful on an unfamiliar system which might have multiple versions of a major program installed (such as an instance of gcc4 under /usr/local to complement the default gcc3 -- note that DragonFly supports a dual gcc setup); it might not hurt to mention echo $PATH as a way to gain a quick insight on a system's binary layout

Examples

Practice Exercises

More information

whatis(1); whereis(1); which(1); locate(1); find(1); sh(1) including "type" built-in, -v and -V; locate.updatedb(8) or locate.conf(5)