Changes

Find and Locate

1,322 bytes added, 18:19, 28 March 2019
The following lines were added (+) and removed (-):
* find it typically present on any linux system while locate is part of mlocate which needs installed* find it typically present on any linux system while locate is part of mlocate / findutils which needs installed* locate program of findutils scans one or more databases of filenames and displays any matches.* The find command is sometimes more useful for searching attached storage and network drives w/o the need to create database tablesAt first it might seem the 'find' command is a better choice, however, although it is more universal, the 'locate' command is better suited for typical searches as well as complex search operations.  The locate utility works better and faster because instead of searching the file system when a file search is initiated it will  look through a prebuilt database that was created by updatedb.  *GNU findutils’ is documented in locatedb(5), and is pretty much just a list of files (with a specific compression algorithm);*mlocate’s is documented in mlocate.db(5), and can also be considered a list of directories and files (with metadata).To locate a file on the filesystem locate filenameYou can limit your search returns to a required number to avoid redundancy with your search results using the -n command. locate -n10 filenamedisplay the count of all matching entries locate -c filenameor with wildcards locate -c filename*case insensitive and suppress error messages, locate -iq filename*information about the locate metabase include last update locate -s
Bureaucrat, administrator
16,212
edits