Install Miller on Ubuntu 26.04

Install Miller on Ubuntu 26.04

Miller is a command-line utility for working with structured data formats such as CSV, TSV, JSON, and more. It behaves similarly to traditional UNIX tools, but is designed specifically for record-oriented data processing, making it useful for filtering, transforming, and inspecting tabular datasets directly in the terminal. This tutorial explains how to install Miller on Ubuntu 26.04.

Install Miller

Start by getting the latest release version number from GitHub:

MILLER_VERSION=$(curl -s "https://api.github.com/repos/johnkerl/miller/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')

Download the corresponding binary archive:

curl -sSLo miller.tar.gz https://github.com/johnkerl/miller/releases/latest/download/miller-$MILLER_VERSION-linux-amd64.tar.gz

Create a temporary working directory and extract the archive contents:

mkdir miller-temp
tar xf miller.tar.gz --strip-components=1 -C miller-temp

Move the Miller executable into a system-wide path:

sudo mv miller-temp/mlr /usr/local/bin

Confirm installation by checking the Miller version:

mlr --version

After installation, temporary files can be removed:

rm -rf miller.tar.gz miller-temp

Testing Miller

Create a simple CSV file for testing purposes:

echo -e 'name,age\nJohn,25\nJames,29\nOliver,35\nEmma,31' > test.csv

Run the following command to display the CSV in a formatted, readable table using Miller:

mlr --icsv --opprint cat test.csv

Output:

name   age
John   25
James  29
Oliver 35
Emma   31

Uninstall Miller

To uninstall Miller from the system, the binary can be deleted from the system path:

sudo rm -rf /usr/local/bin/mlr

Leave a Comment

Cancel reply

Your email address will not be published.