Print the avail list.
Print the bucket number num and set it as the current one.
Print the bucket cache.
Close the currently open database.
Print the number of entries in the database.
Print the current bucket.
GDBM is configured with additional debugging, this
statement queries or sets
GDBM internal debugging level.
This is intended for debugging and testing purposes and requires
good knowledge of
GDBM internals. The use of this command is
Delete record with the given key
Print hash directory.
Downgrade the database from extended to the standard database format. See Numsync.
Export the database to the flat file file-name. See Flat files, for a description of the flat file format and its purposes. This command will not overwrite an existing file, unless the ‘truncate’ parameter is also given. Another optional argument determines the type of the dump (see Flat files). By default, ASCII dump is created.
The global variable
filemode specifies the permissions to use
for the created output file.
Fetch and display the record with the given key.
Fetch and display the first record in the database. Subsequent
records can be fetched using the
next command (see below).
See Sequential, for more information on sequential access.
Compute and display the hash value for the given key.
Print file header.
Print a concise command summary, showing each command verb with its parameters and a short description of what it does. Optional arguments are enclosed in square brackets.
Import data from a flat dump file file-name (see Flat files). If the word ‘replace’ is given as an argument, any records with the same keys as the already existing ones will replace them. The word ‘nometa’ turns off restoring meta-information from the dump file.
Shows the command history list with line numbers. When used without arguments, shows entire history. When used with one argument, displays count last commands from the history. With two arguments, displays count commands starting from nth command. Command numbering starts with 1.
This command is available only if
GDBM was compiled with GNU
Readline. The history is saved in file .gdbmtool_history in
the user’s home directory. If this file exists upon startup, it is read to
populate the history. Thus, command history is preserved between
List the contents of the database.
Sequential access: fetch and display the next record. If the key is given, the record following the one with this key will be fetched.
next commands in row is rather common. A
shortcut is provided to facilitate such use: if the last entered
next, hitting the Enter key repeats it
See Sequential, for more information on sequential access.
Open the database file filename. If used without arguments, the
database name is taken from the variable
If successful, any previously open database is closed and the
filename variable is updated. Otherwise, if the operation
fails, the currently opened database remains unchanged.
This command takes additional information from the following variables:
Name of the database to open, if no argument is given.
File descriptor to use. If set, this must be an open file descriptor
referring to a valid database file. The database will be opened using
gdbm_fd_open (see gdbm_fd_open). The file descriptor will
be closed and the variable unset upon closing the database.
Specifies the permissions to use in case a new file is created.
The database access mode. See The open variable, for a list of its values.
Whether or not to lock the database. Default is
Use the memory mapping. Default is
Synchronize after each write. Default is
See open parameters, for a detailed description of these variables.
Describe the given
GDBM error code.
The description occupies one or two lines. The second line is present if the system error number should be checked when handling this code. In this case, the second line states ‘Examine errno’.
If code is omitted, the latest error that occurred in the current database is described. Second line of the output (if present), contains description of the latest system error.
gdbmtool> perror 3 GDBM error code 3: "File open error" Examine errno.
Close the database and quit the utility.
Recover the database from structural inconsistencies. See Database consistency.
The following options are understood:
Create a backup copy of the original database.
Abort recovery process if n buckets could not be recovered.
Abort recovery process if n keys could not be recovered.
Abort recovery process after n failures. A failure in this context is either a key or a bucket that failed to be recovered.
Print the recovery statistics at the end of the run. The statistics includes number of successfully recovered, failed and duplicate keys and the number of recovered and failed buckets.
Verbosely list each error encountered.
Reorganize the database (see Reorganization).
Execute command via current shell. If command is empty, shell is started without additional arguments. Otherwise, it is run as ‘$SHELL -c command’.
For convenience, command is not parsed as
command line. It is passed to the shell verbatim. It can include
newline characters if these are preceded by a backslash or appear
within singly or doubly quoted strings.
! form, be sure to separate it from command by
whitespace, otherwise it will be treated as readline event specifier.
Analyze two snapshot files and select the most recent of them. In case of error, display a detailed diagnostics and meta-information of both snapshots.
See Manual crash recovery, for a detailed discussion.
gdbmtool commands from the file filename.
Print current program status. The following example shows the information displayed:
Database file: junk.gdbm Database is open define key string define content string
define strings show the defined formats for key and
content data. See definitions, for a detailed discussion of their
Store the data with key in the database. If key already exists, its data will be replaced.
Synchronize the database with the disk storage (see Sync).
Upgrade the database from standard to extended database format. See Numsync.
Print the version of