All pastes #200953 Raw Edit

Someone

public text v1 · immutable
#200953 ·published 2006-10-13 14:02 UTC
rendered paste body
#!/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