diff options
Diffstat (limited to 'doc/gdbmtool.1')
-rw-r--r-- | doc/gdbmtool.1 | 245 |
1 files changed, 245 insertions, 0 deletions
diff --git a/doc/gdbmtool.1 b/doc/gdbmtool.1 new file mode 100644 index 0000000..e6a8f2a --- /dev/null +++ b/doc/gdbmtool.1 | |||
@@ -0,0 +1,245 @@ | |||
1 | .\" This file is part of GDBM. | ||
2 | .\" Copyright (C) 2013 Free Software Foundation, Inc. | ||
3 | .\" | ||
4 | .\" GDBM is free software; you can redistribute it and/or modify | ||
5 | .\" it under the terms of the GNU General Public License as published by | ||
6 | .\" the Free Software Foundation; either version 3, or (at your option) | ||
7 | .\" any later version. | ||
8 | .\" | ||
9 | .\" GDBM is distributed in the hope that it will be useful, | ||
10 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | .\" GNU General Public License for more details. | ||
13 | .\" | ||
14 | .\" You should have received a copy of the GNU General Public License | ||
15 | .\" along with GDBM. If not, see <http://www.gnu.org/licenses/>. */ | ||
16 | .TH GDBM_DUMP 1 "May 8, 2013" "GDBM" "GDBM User Reference" | ||
17 | .SH NAME | ||
18 | gdbmtool \- examine and modify a GDBM database | ||
19 | .SH SYNOPSIS | ||
20 | \fBgdbmtool\fR [\fB\-lmnqrs\fR] [\fB\-b\fR \fISIZE\fR] [\fB\-c\fR \fISIZE\fR]\ | ||
21 | [\fB\-g\fR \fIFILE\fR] [\fB\-\-block\-size\fR=\fISIZE\fR] | ||
22 | [\fB\-\-cache\-size\fR=\fISIZE\fR] [\fB\-\-newdb\fR]\ | ||
23 | [\fB\-\-no\-lock\fR] [\fB\-\-no\-mmap\fR] | ||
24 | [\fB\-\-quiet\fR] [\fB\-\-read\-only\fR] [\fB\-\-synchronize\fR]\ | ||
25 | [\fIDBFILE\fR] | ||
26 | .sp | ||
27 | \fBgdbmtool\fR [\fB\-Vh\fR] ][\fB\-\-help\fR] [\fB\-\-usage\fR] [\fB\-\-version\fR] | ||
28 | .SH DESCRIPTION | ||
29 | The | ||
30 | .B gdbmtool | ||
31 | utility allows you to view and modify an existing GDBM database or to | ||
32 | create a new one. | ||
33 | .PP | ||
34 | The \fIDBFILE\fR argument supplies the name of the database to open. | ||
35 | If not supplied, the default name | ||
36 | .B junk.gdbm | ||
37 | is used instead. | ||
38 | If the named database does not exist, it will be created. An existing | ||
39 | database can be cleared (i.e. all records removed from it) using the | ||
40 | \fB\-\-newdb\fR option (see below). | ||
41 | .PP | ||
42 | After successful startup, | ||
43 | .B gdbmtool | ||
44 | starts a loop, in which it reads | ||
45 | commands from the user, executes them and prints the results on the | ||
46 | standard output. If the standard input is attached to a console, | ||
47 | the program runs in interactive mode. | ||
48 | .PP | ||
49 | The program terminates when the | ||
50 | .B quit | ||
51 | command is given, or end-of-file is detected on its standard input. | ||
52 | .PP | ||
53 | A | ||
54 | .B gdbmtool | ||
55 | command consists of a command verb, optionally | ||
56 | followed by one or more arguments, separated by any amount of white | ||
57 | space. A command verb can be entered either in full or in an | ||
58 | abbreviated form, as long as that abbreviation does not match any other | ||
59 | verb. Many command verbs have also one-letter abbreviation which can | ||
60 | be used instead. | ||
61 | .SH OPTIONS | ||
62 | .TP | ||
63 | \fB\-b\fR, \fB\-\-block\-size\fR=\fISIZE\fR | ||
64 | Set block size. | ||
65 | .TP | ||
66 | \fB\-c\fR, \fB\-\-cache\-size\fR=\fISIZE\fR | ||
67 | Set cache size. | ||
68 | .TP | ||
69 | \fB\-l\fR, \fB\-\-no\-lock\fR | ||
70 | Disable file locking. | ||
71 | .TP | ||
72 | \fB\-m\fR, \fB\-\-no\-mmap\fR | ||
73 | Do not use | ||
74 | .BR mmap (2). | ||
75 | .TP | ||
76 | \fB\-n\fR, \fB\-\-newdb\fR | ||
77 | Create the database, truncating it if it already exists. | ||
78 | .TP | ||
79 | \fB\-q\fR, \fB\-\-quiet\fR | ||
80 | Don't print initial banner. | ||
81 | .TP | ||
82 | \fB\-r\fR, \fB\-\-read\-only\fR | ||
83 | Open database in read-only mode. | ||
84 | .TP | ||
85 | \fB\-s\fR, \fB\-\-synchronize\fR | ||
86 | Synchronize to disk after each write. | ||
87 | .TP | ||
88 | \fB\-h\fR, \fB\-\-help\fR | ||
89 | Print a short usage summary. | ||
90 | .TP | ||
91 | \fB\-\-usage\fR | ||
92 | Print a list of available options. | ||
93 | .TP | ||
94 | \fB\-V\fR, \fB\-\-version\fR | ||
95 | Print program version | ||
96 | .SH SHELL COMMANDS | ||
97 | For command verbs that have single-letter abbreviations, these are | ||
98 | printed after a comma. Either command verb or its abbreviation must | ||
99 | be used, but not both. | ||
100 | .TP | ||
101 | .BR avail ", " A | ||
102 | Print the " | ||
103 | .BR "avail list" . | ||
104 | .TP | ||
105 | \fBbucket\fR, \fBB\fR \fINUM\fR | ||
106 | Print the bucket number \fINUM\fR. | ||
107 | .TP | ||
108 | .BR cache ", " K | ||
109 | Print the bucket cache. | ||
110 | .TP | ||
111 | .BR count ", " c | ||
112 | Print the number of entries in the database. | ||
113 | .TP | ||
114 | .BR current ", " C | ||
115 | Print the current bucket. | ||
116 | .TP | ||
117 | .BR data-zero ", " Z | ||
118 | Toggle data nul-termination. Use | ||
119 | .B status | ||
120 | to examine the current status. | ||
121 | .TP | ||
122 | \fBdelete\fR, \fBd\fR \fIKEY\fR | ||
123 | Delete entry with the given \fIKEY\fR. | ||
124 | .TP | ||
125 | .BR dir ", " D | ||
126 | Print hash directory. | ||
127 | .TP | ||
128 | \fBexport\fR, \fBe\fR \fIFILE\-NAME\fR [\fBtruncate\fR] [\fBbinary\fR|\fBascii\fR] | ||
129 | Export the database to the flat file \fIFILE\-NAME\fR. This is equivalent to | ||
130 | .BR gdbm_dump (1). | ||
131 | |||
132 | This command will not overwrite an existing file, unless the | ||
133 | .B truncate | ||
134 | parameter is also given. Another optional parameter determines the type of | ||
135 | the dump (*note Flat files::). By default, ASCII dump will be created. | ||
136 | .TP | ||
137 | \fBfetch\fR, \fBf\fR \fIKEY\fR | ||
138 | Fetch and display the record with the given \fIKEY\fR. | ||
139 | .TP | ||
140 | .BR first ", " 1 | ||
141 | Fetch and display the first record in the database. Subsequent | ||
142 | records can be fetched using the | ||
143 | .B next | ||
144 | command (see below). | ||
145 | .TP | ||
146 | \fBhash\fR, \fBH\fR \fIKEY\fR | ||
147 | Compute and display hash value for the given \fIKEY\fR. | ||
148 | .TP | ||
149 | .BR header ", " F | ||
150 | Print file header. | ||
151 | .TP | ||
152 | .BR help ", " ? | ||
153 | Print a concise command summary, showing each command letter and | ||
154 | verb with its parameters and a short description of what it does. | ||
155 | Optional arguments are enclosed in square brackets. | ||
156 | .TP | ||
157 | \fBimport\fR, \fBi\fR \fIFILE\-NAME\fR [\fBreplace\fR] [\fBnometa\fR] | ||
158 | Import data from a flat dump file \fIFILE\-NAME\fR. | ||
159 | If the | ||
160 | .B replace | ||
161 | argument is given, any records with the same keys as the already | ||
162 | existing ones will replace them. The | ||
163 | .B nometa | ||
164 | argument turns off restoring meta-information from the dump file. | ||
165 | .TP | ||
166 | .BR key-zero ", " z | ||
167 | Toggle key nul-termination. Use | ||
168 | .B status | ||
169 | to inspect the current state. | ||
170 | .TP | ||
171 | \fBlist\fR, \fBl\fR | ||
172 | List the contents of the database. | ||
173 | .TP | ||
174 | \fBnext\fR, \fBn\fR [\fIKEY\fR] | ||
175 | Sequential access: fetch and display the next record. If the \fIKEY\fR is | ||
176 | given, the record following the one with this key will be fetched. | ||
177 | .TP | ||
178 | \fBprompt\fR \fITEXT\fR | ||
179 | Changes the command prompt to the string \fITEXT\fR. The string can | ||
180 | contain | ||
181 | .BR "escape sequences" , | ||
182 | the special entities consisting of the | ||
183 | .B % | ||
184 | character followed by another character. These sequences are | ||
185 | replaced in the generated prompt as follows: | ||
186 | .sp | ||
187 | .nf | ||
188 | .ta 8n 20n | ||
189 | .ul | ||
190 | Sequence Expansion | ||
191 | \fB%f\fR name of the db file | ||
192 | \fB%%\fR \fB%\fR | ||
193 | .fi | ||
194 | .TP | ||
195 | .BR quit ", " q | ||
196 | Close the database and quit the utility. | ||
197 | .TP | ||
198 | \fBread\fR, \fB<\fR \fIFILE\fR [\fBreplace\fR] | ||
199 | Read entries from \fIFILE\fR and store them in the database. If the | ||
200 | .B replace | ||
201 | parameter is given, any existing records with matching keys will be replaced. | ||
202 | .TP | ||
203 | .BR reorganize ", " r | ||
204 | Reorganize the database. | ||
205 | .TP | ||
206 | .BR status ", " S | ||
207 | Print current program status. The following example shows the | ||
208 | information displayed: | ||
209 | .sp | ||
210 | .nf | ||
211 | .if +2 | ||
212 | Database file: junk.gdbm | ||
213 | Zero terminated keys: yes | ||
214 | Zero terminated data: yes | ||
215 | .fi | ||
216 | .TP | ||
217 | \fBstore\fR, \fBs\fR \fIKEY\fR \fIDATA\fR | ||
218 | Store the \fIDATA\fR with the given \fIKEY\fR in the database. If the | ||
219 | \fIKEY\fR already exists, its data will be replaced. | ||
220 | .TP | ||
221 | .BR version ", " v | ||
222 | Print the version of | ||
223 | .BR gdbm . | ||
224 | .SH "SEE ALSO" | ||
225 | .BR gdbm_dump (1), | ||
226 | .BR gdbm_load (1), | ||
227 | .BR gdbm (3). | ||
228 | .SH "REPORTING BUGS" | ||
229 | Report bugs to <bug\-gdbm@gnu.org>. | ||
230 | .SH COPYRIGHT | ||
231 | Copyright \(co 2013 Free Software Foundation, Inc | ||
232 | .br | ||
233 | .na | ||
234 | License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | ||
235 | .br | ||
236 | .ad | ||
237 | This is free software: you are free to change and redistribute it. | ||
238 | There is NO WARRANTY, to the extent permitted by law. | ||
239 | .\" Local variables: | ||
240 | .\" eval: (add-hook 'write-file-hooks 'time-stamp) | ||
241 | .\" time-stamp-start: ".TH GDBM[A-Z_-]* 1 \"" | ||
242 | .\" time-stamp-format: "%:B %:d, %:y" | ||
243 | .\" time-stamp-end: "\"" | ||
244 | .\" time-stamp-line-limit: 20 | ||
245 | .\" end: | ||