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

Return to:

Send suggestions and report system problems to the System administrator.