manpagez: man pages & more
info gdbm
Home | html | info | man

File: gdbm.info,  Node: gdbm_load,  Next: Exit codes,  Prev: gdbm_dump,  Up: Top

26 The 'gdbm_load' utility
**************************

The 'gdbm_load' utility restores a 'GDBM' database from a flat file.
The utility requires at least one argument: the name of the input flat
file.  If it is '-', the standard input will be read.  The format of the
input file is detected automatically.

   By default the utility attempts to restore the database under its
original name, as stored in the input file.  It will fail to do so if
the input is in binary format.  In that case, the name of the database
must be given as the second argument.

   In general, if two arguments are given, the second one is treated as
the name of the database to create, overriding the file name specified
in the flat file.  All existing keys will be removed from this database
prior to loading from the dump.  Use the '--update' ('-U') option if it
is not what you wish.

   When given the '--update' ('-U') option, 'gdbm_load' will update the
existing database with the data from the dump.  It will bail out if the
dump contains a key that is already present in the database.  To
silently overwrite existing keys, use the '--replace' ('-r') option.

   The utility understands the following command line options:

'-b NUM'
'--block-size=NUM'
     Sets block size.  *Note block_size: Open.

'-c NUM'
'--cache-size=NUM'
     Sets cache size.  *Note GDBM_SETCACHESIZE: Options.

'-M'
'--mmap'
     Use memory mapping.

'-m MODE'
'--mode=MODE'
     Sets the file mode.  The argument is the desired file mode in
     octal.

'-n'
'--no-meta'
     Do not restore file meta-data (ownership and mode) from the flat
     file.

'-r'
'--replace'
     Replace existing keys.  This option can be used only together with
     '--update' ('-U').

'-U'
'--update'
     Update an existing database.  The key/value pairs from the dump
     file will be added to that database, without removing the existing
     keys.  To overwrite keys that are duplicated in the dump file, use
     '--update --replace'.

     If the database does not exist, it will be created.

'-u OWNER[:[GROUP]]'
'--user=OWNER[:[GROUP]]'
     Set file owner.  The OWNER can be either a valid user name or UID.
     Similarly, the GROUP is either a valid group name or GID. If GROUP
     is not given, the main group of OWNER is implied, if OWNER is
     followed by a ':', otherwise the login group of the current user is
     implied.

     User and group parts can be separated by a dot, instead of the
     colon, but such usage is discouraged.

'-h'
'--help'
     Print a concise help summary.

'-V'
'--version'
     Print program version and licensing information and exit.

'--usage'
     Print a terse invocation syntax summary along with a list of
     available command line options.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.