• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

db_load command – generate db database

by admin

The db_load utility reads either the output format used by the dump utilities or (optionally) a flat-text representation created using other tools, and stores it into a Berkeley DB database.

Syntax:

db_load [-nTV] [-c name=value] [-f file] [-h home] [-t btree | hash | queue | recno] file

The input to db_load must be in the output format specified by the db_dump utility, utilities, or as specified for the -T below. The options are as follows:

  • -t – Hash is encrypted using hash code.
  • -f – Specify a text file containing the user name and password. This file format needs to show: odd-numbered lines of user name, even-numbered lines of password.
  • -f – Read from the specified input file instead of from the standard input.
  • -c – Specify configuration options ignoring any value they may have based on the input.
  • -h – Specify a home directory for the database environment.
  • -n – Do not overwrite existing keys in the database when loading into an already existing database.
  • -V – Write the version number to the standard output and exit.

Examples of db_load Command

1. Create a new file users.txt and put the username and password in it:

# db_load -T -t hash -f /users.txt /users.db

2. Specify the database type as btree and specify the home directory of the database environment:

# db_load -T -t btree -h /root - f /users.txt /users.db

3. The database is recno and put the user name and password into vsftpd_login.db:

# db_load -T -t recno -f /etc/vsftpd/logins.txt /etc/vsftd/vsftpd_login.db

4. The db_load utility can be used to load text files into databases. For example, the following command loads the standard UNIX /etc/passwd file into a database, with the login name as the key item and the entire password entry as the data item:

$ awk -F: '{print $1; print $0}' < /etc/passwd | sed 's/\\/\\\\/g' | db_load -T -t hash passwd.db

Filed Under: Linux

Some more articles you might also be interested in …

  1. lvrename Command Examples in Linux
  2. How to Extend allowed number of loopback devices
  3. lsdev: command not found
  4. pw-loopback Command Examples in Linux
  5. How to prevent SSH connections from disconnecting due to inactivity when using MobaXterm
  6. cal Command Examples in Linux
  7. BTRFS: too many missing devices, writeable mount is not allowed
  8. vmstat: command not found
  9. fuser Command Examples in Linux
  10. How to use the “screen” command in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright