BSD Newsletter.com
   Front | Info | Lists | Newsfeeds | Study Guide | What is BSD?
Advertisement: The OpenBSD PF Packet Filter Book: PF for NetBSD, FreeBSD, DragonFly and OpenBSD

BSD Links
·New Links
·Advocacy
·Drivers
·Events
·Flavours
·FAQs
·Guides
·Programming
·Security
·Software
·User Groups

This is the BSDA Study Guide Book written via a wiki collaboration. This is a work in progress. You may contribute to or discuss this specific page at http://bsdwiki.reedmedia.net/wiki/Locate_files_and_binaries_on_a_system.html.

Locate files and binaries on a system

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) 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)



Front | Information | Lists | Newsfeeds