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: the PRUNE_BIND_MOUNTS, PRUNEFS, PRUNENAMES and PRUNEPATHS variables β€” which some of these options mess with β€” are documented in detail in updatedb.conf(5). go read that if you want the full lore. πŸ“–
  • -f, --add-prunefs FS β€” add entries in the white-space-separated list FS to PRUNEFS.
  • -n, --add-prunenames NAMES β€” add entries in the white-space-separated list NAMES to PRUNENAMES.
  • -e, --add-prunepaths PATHS β€” add entries in the white-space-separated list PATHS to PRUNEPATHS.
  • --add-single-prunepath PATH β€” add PATH to PRUNEPATHS. 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-root PATH β€” 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. πŸ’…
  • --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, --output FILE β€” write the database to FILE instead of using the default database. custom destination, main character choices. ✨
  • --config-file FILE β€” 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). πŸ’…
  • --prune-bind-mounts FLAG β€” set PRUNE_BIND_MOUNTS to FLAG, overriding the configuration file.
  • --prunefs FS β€” set PRUNEFS to FS, overriding the configuration file.
  • --prunenames NAMES β€” set PRUNENAMES to NAMES, overriding the configuration file.
  • --prunepaths PATHS β€” set PRUNEPATHS to PATHS, overriding the configuration file.
  • -l, --require-visibility FLAG β€” 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 0 or no, 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 running locate(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 1 or yes (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 than locate(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.
  • -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 read db_file can get the complete list of files in the subtree of source_directory. so like... share accordingly. that's not a drill, that's just facts. 😭

πŸ¦‹ FILES πŸ¦‹

  • /etc/updatedb.conf β€” the default configuration file. see updatedb.conf(5). uses exactly the same format as the one used by mlocate(1)'s updatedb, 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 πŸ’«

locate(1), updatedb.conf(5)


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