manpagez: man pages & more
info gdbm
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

20.2.2 Gdbmtool Commands

command verb: avail

Print the avail list.

command verb: bucket num

Print the bucket number num and set it as the current one.

command verb: cache

Print the bucket cache.

command verb: close

Close the currently open database.

command verb: count

Print the number of entries in the database.

command verb: current

Print the current bucket.

command verb: delete key

Delete record with the given key

command verb: dir

Print hash directory.

command verb: export file-name [truncate] [binary|ascii]

Export the database to the flat file file-name. See section Export and Import, 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 section Export and Import). By default, ASCII dump is created.

The global variable filemode specifies the permissions to use for the created output file.

See also Export a database into a portable format..

command verb: fetch key

Fetch and display the record with the given key.

command verb: first

Fetch and display the first record in the database. Subsequent records can be fetched using the next command (see below). See section Sequential access to records., for more information on sequential access.

command verb: hash key

Compute and display the hash value for the given key.

command verb: header

Print file header.

command verb: help
command verb: ?

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.

command verb: import file-name [replace] [nometa]

Import data from a flat dump file file-name (see section Export and Import). 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.

command verb: list

List the contents of the database.

command verb: next [key]

Sequential access: fetch and display the next record. If the key is given, the record following the one with this key will be fetched.

See also first, above.

See section Sequential access to records., for more information on sequential access.

command verb: open filename

Open the database file filename. If successful, any previously open database is closed. Otherwise, if the operation fails, the currently opened database remains unchanged.

This command takes additional information from the following variables:


The database access mode. See The open variable, for a list of its values.


Whether or not to lock the database. Default is ‘on’.


Use the memory mapping. Default is ‘on’.


Synchronize after each write. Default is ‘off’.


Specifies the permissions to use in case a new file is created.

See open parameters, for a detailed description of these variables.

command verb: quit

Close the database and quit the utility.

command verb: reorganize

Reorganize the database (see section Database reorganization.).

command verb: source filename

Read gdbmtool commands from the file filename.

command verb: status

Print current program status. The following example shows the information displayed:

Database file: junk.gdbm
Database is open
define key string
define content string

The two ‘define’ strings show the defined formats for key and content data. See section Data Definitions, for a detailed discussion of their meaning.

command verb: store key data

Store the data with key in the database. If key already exists, its data will be replaced.

command verb: version

Print the version of gdbm.

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on January 24, 2014 using texi2html 5.0.

© 2000-2018
Individual documents may contain additional copyright information.