UPDATEDB(1)

πŸ“¦
version 4.10.0 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, nixos 26.05

✨ UPDATEDB(1) ✨

okay bestie, so this is the updatedb manual page, straight out of the General Commands Manual section of your friendly neighbourhood man pages πŸ’– pull up a chair, we're building a file name database and it's gonna be iconic.


🌸 NAME 🌸

updatedb β€” update a file name database. that's it. that's the whole job. she updates, she slays, she goes home πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

updatedb [options]

like, options are optional, she's flexible, she contains multitudes ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so this page right here documents the GNU version of updatedb, and what she does is update the file name databases that GNU locate uses πŸ”₯

and what even is a file name database, you ask? it's literally a list of files β€” the files that were chillin' in particular directory trees back when the database was last updated. so it's a snapshot. a little time capsule of ur filesystem πŸ“Έ

the file name of the default database? that gets determined whenever locate and updatedb are configured and installed. so it depends on ur setup, bestie. and how often the databases get updated, plus which directories they have entries for, all depends on how often you run updatedb and with which arguments. you are the main character here β€” the behaviour follows you πŸ‘‘

now, in networked environments (iykyk), it often makes sense to build a database at the root of each filesystem, containing the entries for that filesystem. then you run updatedb for each filesystem on the fileserver where that filesystem is on a local disk β€” the whole point being to prevent thrashing the network πŸ™ˆ nobody wants that. users can pick which databases locate searches using an environment variable or a command line option; peep locate(1) for that. and heads up: databases cannot be concatenated together. no merging, no gluing, no franken-database πŸ’€

okay history lesson, because she's that girl πŸ“š the LOCATE02 database format got introduced in GNU findutils version 4.0, specifically so that machines with different byte orderings could share databases. teamwork! and GNU locate can read both the old format and LOCATE02, though ngl, support for the old pre-4.0 database format will be removed shortly. so like. don't get attached πŸ’”


✨ OPTIONS ✨

  • --findoptions='-option1 -option2...' β€” global options you pass on to find. the environment variable FINDOPTIONS also sets this value. default is none. nothing. nada 🫢
  • --localpaths='path1 path2...' β€” non-network directories to put in the database. default is /. yes, the whole thing, she's ambitious πŸ’…
  • --netpaths='path1 path2...' β€” network directories (NFS, AFS, RFS, etc.) to put in the database. the environment variable NETPATHS also sets this value. default is none 🌸
  • --prunepaths='path1 path2...' β€” directories to not put in the database, which would otherwise be in there. and listen: remove any trailing slashes from the path names, otherwise updatedb won't recognise the paths you want to omit β€” because she uses them as regular expression patterns, bestie 🧚 default is /tmp /usr/tmp /var/tmp /afs. the environment variable PRUNEPATHS also sets this value.
  • --prunefs='path...' β€” file systems to not put in the database, which would otherwise be in there. note that files get pruned when a file system is reached, so any file system mounted under an undesired file system will be ignored. the environment variable PRUNEFS also sets this value. default is nfs NFS proc πŸ’œ
  • --output=dbfile β€” the database file to build. default is system-dependent. and on Debian GNU/Linux, the default is /var/cache/locate/locatedb ⭐
  • --localuser=user β€” the user to search non-network directories as, using su(1). default is to search the non-network directories as the current user. you can also use the environment variable LOCALUSER to set this user πŸ‘‘
  • --netuser=user β€” the user to search network directories as, using su(1). default is daemon. you can also use the environment variable NETUSER to set this user 🌈
  • --dbformat=F β€” create the database in format F. the default format is called LOCATE02. alternatively the slocate format is also supported. when the slocate format is in use, the database produced is marked as having security level 1. and if you want to build a system-wide slocate database, you may want to run updatedb as root πŸ”₯
  • --version β€” print the version number of updatedb and exit. short, sweet, iconic πŸ’–
  • --help β€” print a summary of the options to updatedb and exit. ur little cheat sheet πŸŽ€

😭 BUGS 😭

the updatedb program correctly handles filenames containing newlines β€” but only if the system's sort command has a working -z option. so like, conditional slay πŸ’€

if you suspect that locate may need to return filenames containing newlines, consider using its --null option. just a lil tip 🫢


πŸ“£ REPORTING BUGS πŸ“£

GNU findutils online help: <https://www.gnu.org/software/findutils/#get-help>

report any translation bugs to <https://translationproject.org/team/>

report any other issue via the form at the GNU Savannah bug tracker: <https://savannah.gnu.org/bugs/?group=findutils>

general topics about the GNU findutils package are discussed at the bug-findutils mailing list: <https://lists.gnu.org/mailman/listinfo/bug-findutils>

(not me pasting every single link, we leave NO detail behind πŸ’…)


Copyright Β© 1994–2024 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.

this is free software: you are free to change and redistribute it. there is NO WARRANTY, to the extent permitted by law. (say it with me: no warranty, no cap 😀)


🫢 SEE ALSO 🫢

full documentation <https://www.gnu.org/software/findutils/updatedb> or available locally via: info updatedb ✨


and that's the whole page, bestie πŸ¦‹ this was UPDATEDB(1) from the General Commands Manual, GNU findutils era, dated 1994–2024 and still eating πŸ’– go forth and update ur database, u absolute icon πŸ‘‘πŸ’…

πŸ“¦ where this page comes from