How to Geek on Google+

Lori Kaufman is a writer who likes to write geeky how to articles to understand where the binary, source, and man page files for commands used in Linux to find where are located. You can also update it yourself at any time so you can obtain ‘up to the minute’ results, the database is updated periodically from cron.

Now regarding the aforementioned fact… The locate command is faster than the find command since it uses a previously built database, whereas the find command searches in the real system, through all the actual directories and files.

/usr/bin/locate binary file changes to point to mlocate, when you install mlocate.

linux

The most common wildcard symbols are the question which stands for a single character and the asterisk which stands for a contiguous string of characters.

The backslash in the above-mentioned command is a globbing character, that provides a way of expanding wildcard characters in a non specific file name into a set of specific filenames. It keeps timestamp information in the database, when you update the mlocate database. The mlocate command is a brand new implementation of locate. By the way, the search results only include files to which the current user has access, it indexes the entire file system. Whereis command displays everything it finds whereas the which command only displays the first executable it finds, whenit gets to results displayed by default. It’s a well you can use a graphical file manager to find files in Linux, like Nautilus in Gnome, Dolphin in KDE, and Thunar in Xfce.

Use the -name argument, to find files that match a specific pattern.

Command whereis -b firefox will display only /usr/bin/firefox as the result.

Basically not the paths to the source and the man pages, use the -b option, So if you seek for only the path to the executable to display. This is handy since you will most probably search for a program’s executable file more often than you would search for source and man pages for that program. The find command has loads of options available for refining the search. Oftentimes the where is command searches through a list of specific directories for the binary, source, and man files whereas the which command searches the directories listed in the current user’s PATH environment variable. For more information about either the locate or the mlocate command, type man locate or man mlocate at the command prompt in a Terminal window and press Enter.

Laura Thornton