DB(1) | General Commands Manual | DB(1) |
db
—
db |
[-DKiNqV ] [-E
endian] [-f
infile] [-O
outsep] [-S
visitem] [-T
visspec] [-U
unvisitem] [-X
extravis] type
dbfile [key
[...]] |
db |
-d [-iNq ]
[-E endian]
[-f infile]
[-T visspec]
[-U unvisitem]
type dbfile
[key [...]] |
db |
-w [-CDiNqR ]
[-E endian]
[-F insep]
[-f infile]
[-m mode]
[-P pagesize]
[-T visspec]
[-U unvisitem]
type dbfile
[key value
[...]] |
db
allows manipulation of
btree(3) and
hash(3)
(db(3)) databases.
db
has three modes of operation to perform
upon dbfile:
-d
. Deletes the given
keys, and keys described in
infile.-w
. Writes the given
keys and values, and keys and
values described in infile (in the latter case,
entries are separated by insep).There are two mandatory arguments: type is the database type; either ‘btree’ or ‘hash’, and dbfile is the database file to manipulate.
Options valid for all modes are:
-E
endian-f
infilestdin
is
used.-i
-N
By convention, each key and value in the underlying database
is terminated with a NUL byte, although it is possible to have keys or
values that are not so terminated. Without the
-N
option, db
adds a NUL
terminator to any keys and values specified on the command line or in
the input file, before searching or modifying the underlying database,
and removes the last byte (which is usually a NUL terminator) before
printing any keys and values retrieved from the underlying database.
With the -N
option, db
does not add or remove a terminating byte. The
-S
, -T
, and
-U
options may be useful to encode the NUL
terminator in a readable form.
-q
-d
) and write
(-w
) modes, the result of various operations is
suppressed.-T
visspec-S
option
are encoded and -U
option are decoded. The
visspec option-argument is a string specifying
strsvisx(3) flags. The
string consists of one or more characters:
VIS_NOSLASH
VIS_CSTYLE
.
Overrides h and o.VIS_HTTPSTYLE
.
Overrides c and o.VIS_OCTAL
.
Overrides c and h.VIS_SAFE
VIS_TAB
VIS_WHITE
-U
only supports
-T
h.
See vis(1)'s corresponding options for the meaning of these characters, and strsvisx(3) for more detail on the flags.
-U
unvisitemRead mode specific options are:
-D
-K
-O
outsep-S
visitem-V
-X
extravis-S
option also encode
characters in extravis, per
strsvisx(3).-K
or
-V
is given, both options are enabled.)Write mode specific options are:
-C
-D
-R
to be useful.)-F
insep-m
mode-P
pagesize-R
db
command appeared in NetBSD
2.0.
February 17, 2012 | NetBSD 9.4 |