Women in Technology

Hear us Roar



Hack:   Playing Hunt the Disk Hog
Subject:   another (better?) way to do this
Date:   2003-12-23 03:43:34
From:   anonymous2
Response to: another (better?) way to do this

Maybe you will like this one.
ls -A don't show the current and parent directory (; &..) su du don't go up.


ls -A | grep -v -e '^\.\.$' |xargs -i du -ks {} |sort -rn |head -11 | awk '{print $2}' | xargs -i du -hs {}

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • another (better?) way to do this
    2004-09-16 12:16:56  kj6loh [View]

    Actually, I don't understand the need for the second xargs? This is from my alias list
    alias dh='ls -a | grep -v -e '\''^\.\.$'\'' |xargs -i du -s {} |sort -nr |sed -n '\''2,$p'\''|head'
    Not quite the same but very similar. If you really want the h put it in after the du. Oh you'll probably have to escape the last dollar sign.

Showing messages 1 through 1 of 1.