updatedb(8)
π updatedb β like, the manual page, but make it make sense π
okay bestie, so this is updatedb from the System Manager's Manual, section 8 (that's the "admin commands" section, iykyk). pull up a chair, grab a boba, we're doing this. π§
β¨ NAME β¨
updatedb β update a database for plocate. that's it. that's the whole job. she updates the database. π
πΈ SYNOPSIS πΈ
updatedb [OPTION]...
just options, babe. no required arguments. she's flexible like that. π¦
π DESCRIPTION π
updatedb creates or updates a database used by locate(1). so like, locate is the one doing the searching, and updatedb is the one making sure the search actually knows stuff. girlboss behind the scenes energy fr fr. π
and here's the lowkey genius part: if the database already exists, its data is reused to avoid rereading directories that have not changed. so she's not out here doing the most for no reason β she's smart, she's efficient, she remembers what she already knows. we stan a queen who doesn't redo work. β¨
updatedb is usually run daily from a systemd.timer(8) to update the default database. so yeah, she's out here on a schedule, doing her little daily routine, no drama. π
π EXIT STATUS π
0β success. slay. everything ate, no crumbs. π1β error. something went wrong and she's telling you about it. π
π₯ OPTIONS π₯
heads up bestie: thePRUNE_BIND_MOUNTS,PRUNEFS,PRUNENAMESandPRUNEPATHSvariables β which some of these options mess with β are documented in detail inupdatedb.conf(5). go read that if you want the full lore. π
-f,--add-prunefsFS β add entries in the white-space-separated list FS toPRUNEFS.-n,--add-prunenamesNAMES β add entries in the white-space-separated list NAMES toPRUNENAMES.-e,--add-prunepathsPATHS β add entries in the white-space-separated list PATHS toPRUNEPATHS.--add-single-prunepathPATH β add PATH toPRUNEPATHS. ngl, note that this is currently the only way to add a path with a space in it. spaces are little gremlins and this is the workaround. π-U,--database-rootPATH β store only results of scanning the file system subtree rooted at PATH to the generated database. the whole file system is scanned by default (she's thorough like that).- lowkey important:
locate(1)outputs entries as absolute path names which don't contain symbolic links, regardless of the form of PATH. so don't come for her about symlinks, she said what she said. π
- lowkey important:
--debug-pruningβ write debugging information about pruning decisions to standard error output. for when you're like "why did she skip that??" and need the receipts. π-h,--helpβ write a summary of the available options to standard output and exit successfully. the classic "help me bestie" button. π«Ά-o,--outputFILE β write the database to FILE instead of using the default database. custom destination, main character choices. β¨--config-fileFILE β read configuration from FILE instead of the default configuration file. command-line options still override settings from the file (CLI stays winning, as she should). π- see
updatedb.conf(5)for the configuration file format.
- see
--prune-bind-mountsFLAG β setPRUNE_BIND_MOUNTSto FLAG, overriding the configuration file.--prunefsFS β setPRUNEFSto FS, overriding the configuration file.--prunenamesNAMES β setPRUNENAMESto NAMES, overriding the configuration file.--prunepathsPATHS β setPRUNEPATHSto PATHS, overriding the configuration file.-l,--require-visibilityFLAG β set the "require file visibility before reporting it" flag in the generated database to FLAG. okay this one is the whole plot twist, sit down. π- if FLAG is
0orno, or if the database file is readable by"others"or it is not owned by plocate,locate(1)outputs the database entries even if the user runninglocate(1)could not have read the directory necessary to find out the file described by the database entry. (so like... privacy? not really giving privacy. π) - if FLAG is
1oryes(the default),locate(1)checks the permissions of parent directories of each entry before reporting it to the invoking user. to make the file existence truly hidden from other users, the database group is set to plocate and the database permissions prohibit reading the database by users using other means thanlocate(1), which is set-gid plocate. yes girl, she built a whole permission system. π - note that the visibility flag is checked only if the database is owned by plocate and it is not readable by
"others". both conditions. no skipping. periodt.
- if FLAG is
-v,--verboseβ output path names of files to standard output, as soon as they are found. she's narrating her every move. very "let her cook". π-V,--versionβ write information about the version and license of locate on standard output and exit successfully. (yes, it says "locate". that's what the manpage says. keeping it exactly as written bestie. π€)
π EXAMPLES π
want to create a private plocate database as a user other than root? run this, iconic behavior:
updatedb -l 0 -o db_file -U source_directory
β οΈ and note that all users that can readdb_filecan get the complete list of files in the subtree ofsource_directory. so like... share accordingly. that's not a drill, that's just facts. π
π¦ FILES π¦
/etc/updatedb.confβ the default configuration file. seeupdatedb.conf(5). uses exactly the same format as the one used bymlocate(1)'supdatedb, so they can be shared. compatibility queen fr fr. π«Ά/var/lib/plocate/plocate.dbβ the database updated by default. her home base. π
π¨ SECURITY π¨
databases built with --require-visibility no allow users to find names of files and directories of other users, which they would not otherwise be able to do.
read that again. this is the actual warning, not me being dramatic for once. if you turn visibility off, people can see what they shouldn't. protect your besties. ππ
π AUTHOR π
- Miloslav Trmac
<mitr@redhat.com> - Steinar H. Gunderson
<steinar+plocate@gunderson.no>
two absolute legends. credit where credit is due. β¨
π« SEE ALSO π«
and that's the whole page babes π this was plocate, from Dec 2020, and you just read the entire updatedb(8) manual like a scholar. so proud of you. go update your database. ππβ
π¦ where this page comes from
- fedora 43: plocate 1.1.25-2.fc43 Β· GPL-2.0-or-later AND GPL-2.0-only
- fedora 44: plocate 1.1.24-1.fc44 Β· GPL-2.0-or-later AND GPL-2.0-only
- fedora 44: plocate 1.1.25-2.fc44 Β· GPL-2.0-or-later AND GPL-2.0-only
- Copyright (C) 2005, 2007, 2008 Red Hat, Inc. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms