How did I not know about sort -h until today?
@david_chisnall TIL!
Old skool me has -h hardwirred to 'help'
@david_chisnall lolwut? I salute you for admitting to it though.
@david_chisnall I learned about it not too long ago and I was equally happy and annoye nobody told me about it before
@david_chisnall -h for help and -H for host is wired for me, no matter the utility. Thanks!
@fbfortune did you know???
@david_chisnall I'm this close to ssh'ing from my phone. Mental note: look up -h arg later.
@WildEyedBoyFromFreecloud @david_chisnall since I had to look it up too lol:
-h, --human-numeric-sort
compare human readable numbers (e.g., 2K 1G)
@canaryX @WildEyedBoyFromFreecloud
Importantly, it means I can do things like du -hd1 | sort -h and get human-readable sorted list of how much space each subdirectory in the current directory is using. For some reason, I wasn't aware that you could do this.
@david_chisnall @canaryX This is what I've been needing for backing up photos! Thx
@david_chisnall @canaryX @WildEyedBoyFromFreecloud One of my faves is 'du -sh' and I pronounce it every time.
@david_chisnall @canaryX @WildEyedBoyFromFreecloud I used to do `du --max-depth=1 | sort -g`, so this is a nice replacement.
@david_chisnall try `df -h` and I think `free -h` works too. The one thing I'm really missing from `sort`? A *count* of unique values as with `sort -u`, which afaict is still most easily obtained with `sort | uniq -c`.
`du -chs * | sort -h` is muscle memory for over a decade now though.