DuckDB CLI is an embedded, serverless command-line interface for running SQL, inspecting results, and processing local or remote data files without a separate database installation. section 2.1 section 2.3
Use the CLI to move from quick exploration to repeatable data pipelines:
- Launch a transient in-memory database with duckdb, or open a persistent database file. section 2.3
- Control execution and output with options such as -readonly, -json, -line, -c, and -s. section 2.3.3
- Query CSV files directly from URLs, including short links handled explicitly with read_csv_auto. section 2.5
- Pipe standard input and output to create CSV files, or use COPY ... TO to write Parquet. section 2.5.1
Analyze and export a remote CSV
Run `duckdb --json -c 'SELECT count(*) FROM read_csv_auto("https://bit.ly/3KoiZR0");'` to return a machine-readable record count. For a reusable export, run `duckdb -csv -s "SELECT Country, Population, Birthrate, Deathrate FROM read_csv_auto('https://bit.ly/3KoiZR0') WHERE trim(region) = 'WESTERN EUROPE'" > western_europe.csv`. Write Parquet explicitly with `COPY (...) TO 'western_europe.parquet' (FORMAT PARQUET)`. section 2.3.3 section 2.5 section 2.5.1
Listing 2.2 Getting DuckDB running on Linux
wget https://github.com/duckdb/duckdb/releases/download/v0.10.0/\ duckdb_cli-linux-amd64.zip #1 unzip duckdb_cli-linux-amd64.zip ./duckdb -version
Use the Linux installation listing to download the CLI archive, unpack it, and verify the executable version. section 2.2.2
