Quick Tip: List docker images sorted by size

The docker image ls command has an option for filtering output but what if we want to sort the images to find the really hefty ones? You know, the ones that might need to go the way of Old Yeller. Huh? What’s that, docker? You can’t do that. If you want something done right… It ain’t pretty but it works. docker image ls --format "{{.Repository}}:{{.Tag}} {{.Size}}" | \ awk '{if ($2~/GB/) print substr($2, 1, length($2)-2) * 1000 "MB - " $1 ; else print $2 " - " $1 }' | \ sed '/^0/d' | \ sort -n Side Note [Read More]

Quick Tip: Make a directory and enter it with one command

We all make directories. It’s one way that we attempt to bring order to the chaos that is the filesystem. We’re also pretty lazy. Creating a new directory and navigating into it is usually a two command affair: mkdir order-i-say cd order-i-say Not anymore it isn’t: mkdir quickly-now && cd $_ Explanation $_ is the last argument passed to the previous command. In our case, it’s the directory name. There’s a lot more here. [Read More]