Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example bash script using the QuickHist API.
#!/usr/bin/env bash
# Below is a one-liner that'll fetch you a histogram
# for the available filesystem spaces in your computer.
# You can run the command directly from your unix terminal.
curl $(echo ","$(df -h | awk '{print $1,$5}' | tail -n +2 | sed 's/%//g;s/G//g;H;${x;s/\n/,/g;s/^,//;p;};d;' | sed 's/\s\+/=/g;s/\//-/g;')) --silent | sed '1,2d;$d'
# The sed '1,2d;$d' is to remove HTML markup (first two lines and the last).
# You can ignore it; the histogram is
# distinctly visible amidst the markup anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment