#!/bin/bash # "du -sh" sorted by size du -sh $(du -s "$@" | sort -n | awk '{print $2}') exit $? ## Comments and ideas ## # Right align the size: dusort * | sed -e 's/^\([0-9]\t\)/ \1/' -e 's/^\([0-9]\{2\}[KMG]\t\)/ \1/' # Swap columns # Looks bad. Maybe this + right align dusort * | awk '{print $2 " " $1}' | column -t # Multi column # Uses 'column -t' first to fix tab dusort * | column -t | column