DuckDB has many client APIs. When you are getting started with this database management system, it may make sense to become familiar with its command line interface (CLI) first.
Note: If you are not familiar with the GNU/Linux command line interface, or you intend to use a script obtained from this site, review the Conventions page before proceeding.
Direct downloads for the CLI client are available from install.duckdb.org. For example, the following commands install the CLI client from the direct download link for version 2.0.0 to ${HOME}/bin/:
$ bin_dir="${HOME}/bin/" \
&& dl_url='https://install.duckdb.org/v2.0.0/duckdb-cli-linux-amd64.tar.gz' \
&& if ! [[ -d "${bin_dir}" ]]; then
mkdir "${bin_dir}"
fi \
&& wget --directory-prefix="${bin_dir}" --quiet "${dl_url}" \
&& cd "${bin_dir}" \
&& tar -xf 'duckdb-cli-linux-amd64.tar.gz' \
&& chmod 700 duckdb \
&& rm 'duckdb-cli-linux-amd64.tar.gz' \
&& cd - > '/dev/null' 2>&1
If ${HOME}/bin/ is in your environment's PATH, you should be able to run the DuckDB CLI client by entering duckdb. Otherwise, you can enter the client's absolute or relative path to start it.
An easier way to manage the DuckDB CLI client is to ensure that you have pipx installed and configured, and then use pipx to install the DuckDB CLI client:
pipx install duckdb-cli
pipx makes upgrades easier, as well. For example, to upgrade the DuckDB CLI client, run:
pipx upgrade duckdb-cli
The client will also be upgraded when you upgrade all pipx-installed packages:
pipx upgrade-all