OSDN Git Service

info/GNU_which: Add some explanations.
[linuxjm/jm.git] / manual / GNU_findutils / original / man1 / updatedb.1
1 .TH UPDATEDB 1 \" -*- nroff -*-
2 .SH NAME
3 updatedb \- update a file name database
4 .SH SYNOPSIS
5 .B updatedb [\fIoptions\fP]
6 .
7 .SH DESCRIPTION
8 This manual page
9 documents the GNU version of
10 .BR updatedb ,
11 which updates file name databases used by GNU
12 .BR locate .
13 The file name databases contain lists of files that were in
14 particular directory trees when the databases were last updated.
15 The file name of the default database is determined when \fBlocate\fP
16 and \fBupdatedb\fP are configured and installed.  The frequency with
17 which the databases are updated and the directories for which they
18 contain entries depend on how often \fBupdatedb\fP is run, and with
19 which arguments.
20 .P
21 In networked environments, it often makes sense to build a database at
22 the root of each filesystem, containing the entries for that filesystem.
23 .B updatedb
24 is then run for each filesystem on the fileserver where that
25 filesystem is on a local disk, to prevent thrashing the network.
26 Users can select which databases \fBlocate\fP searches using an
27 environment variable or command line option; see \fBlocate\fP(1).
28 Databases cannot be concatenated together.
29 .P
30 The
31 .B LOCATGE02
32 database format was introduced in GNU findutils
33 version 4.0 in order to allow machines with different byte orderings
34 to share the databases.  GNU
35 .B locate
36 can read both the old and
37 .B LOCATE02
38 database formats, though
39 support for the old pre-4.0 database format will be removed shortly.
40 .
41 .SH OPTIONS
42 .TP
43 .B \-\-findoptions='\fI\-option1 \-option2...\fP'
44 Global options to pass on to \fBfind\fP.
45 The environment variable \fBFINDOPTIONS\fP also sets this value.
46 Default is none.
47 .TP
48 .B \-\-localpaths='\fIpath1 path2...\fP'
49 Non-network directories to put in the database.
50 Default is /.
51 .TP
52 .B \-\-netpaths='\fIpath1 path2...\fP'
53 Network (NFS, AFS, RFS, etc.) directories to put in the database.
54 The environment variable \fBNETPATHS\fP also sets this value.
55 Default is none.
56 .TP
57 .B \-\-prunepaths='\fIpath1 path2...\fP'
58 Directories to not put in the database, which would otherwise be.
59 Remove any trailing slashes from the path names, otherwise
60 .B updatedb
61 won't recognise the paths you want to omit (because it uses them as
62 regular expression patterns).
63 The environment variable \fBPRUNEPATHS\fP also sets this value.
64 Default is /tmp /usr/tmp /var/tmp /afs.
65 .TP
66 .B \-\-prunefs='\fIpath...\fP'
67 File systems to not put in the database, which would otherwise be.
68 Note that files are pruned when a file system is reached;
69 any file system mounted under an undesired file system will be
70 ignored.
71 The environment variable
72 \fBPRUNEFS\fP also sets this value.
73 Default is \fInfs NFS proc\fP.
74 .TP
75 .B \-\-output=\fIdbfile\fP
76 The database file to build.
77 Default is system-dependent.  In Debian GNU/Linux, the default
78 is /var/cache/locate/locatedb.
79 .TP
80 .B \-\-localuser=\fIuser\fP
81 The user to search non-network directories as, using \fBsu\fP(1).
82 Default is to search the non-network directories as the current user.
83 You can also use the environment variable \fBLOCALUSER\fP to set this user.
84 .TP
85 .B \-\-netuser=\fIuser\fP
86 The user to search network directories as, using \fBsu\fP(1).
87 Default is \fBdaemon\fP.
88 You can also use the environment variable \fBNETUSER\fP to set this user.
89 .TP
90 .B \-\-dbformat=F
91 Create the database in format F.  The default format is called LOCATE02.
92 Alternatively the
93 .B slocate
94 format is also supported.  When the
95 .B slocate
96 format is in use, the database produced is marked as having security
97 level 1.  If you want to build a system-wide
98 .B slocate
99 database, you may want to run
100 .B updatedb
101 as root.
102 .TP
103 .B \-\-version
104 Print the version number of
105 .B updatedb
106 and exit.
107 .TP
108 .B "\-\-help"
109 Print a summary of the options to
110 .B updatedb
111 and exit.
112 .
113 .SH "BUGS"
114 The
115 .B updatedb
116 program correctly handles filenames containing newlines,
117 but only if the system's sort command has a working
118 .I \-z
119 option.  If you suspect that
120 .B locate
121 may need to return filenames containing newlines, consider using its
122 .I \-\-null
123 option.
124 .
125 .SH "REPORTING BUGS"
126 GNU findutils online help: <https://www.gnu.org/software/findutils/#get-help>
127 .br
128 Report any translation bugs to <https://translationproject.org/team/>
129 .PP
130 Report any other issue via the form at the GNU Savannah bug tracker:
131 .RS
132 <https://savannah.gnu.org/bugs/?group=findutils>
133 .RE
134 General topics about the GNU findutils package are discussed at the
135 .I bug\-findutils
136 mailing list:
137 .RS
138 <https://lists.gnu.org/mailman/listinfo/bug-findutils>
139 .RE
140 .
141 .SH COPYRIGHT
142 Copyright \(co 1994-2022 Free Software Foundation, Inc.
143 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
144 .br
145 This is free software: you are free to change and redistribute it.
146 There is NO WARRANTY, to the extent permitted by law.
147 .
148 .SH "SEE ALSO"
149 .BR find (1),
150 .BR locate (1),
151 .BR xargs (1),
152 .BR locatedb (5)
153 .PP
154 Full documentation <https://www.gnu.org/software/findutils/updatedb>
155 .br
156 or available locally via:
157 .B info updatedb