locate Flashcards
locate
locate reads one or more databases prepared by updatedb(8) and writes file names matching at least one of the PATTERNs to standard output, one per line.
locate
locate alone will search for a file or name.
locate “*.html” -n 20
Limits the search quieries to a specific number with the -n flag.
locate -c [tech]*
Displays the number of matching entries with the -c option.
lcoate -i *text.txt*
Makes the search case insensitive with the -i option.
updatedb
This command will update the mlocate database.
locate -i -e *text.txt*
This command only prints out files that existed when the locate command was run and not after. That is why the -e, –existing option was used.
locate -i -0 *text.txt*
The -0 option causes the locate command to output entries without a newline.
locate -S
This command will display the mlocate.db file for viewing.
locate -q
The -q option suppresses any error messages.
locate -d <new> <filename></filename></new>
The -d option will point the locate command to a different mlocate.db file.