X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=home%2Flib%2Flogin_functions.sh;fp=home%2Flib%2Flogin_functions.sh;h=9b8b86354553411398ffa5f57ab6f551abb97878;hb=27456eb6c27c4f0a0d4eb6fb412f3bb514e1a959;hp=13a2ba298abb41e34b7fa57175a3b4dbbd90c00a;hpb=f13f270e286d45028dec9bc2f61414309c5c2661;p=khome.git diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index 13a2ba2..9b8b863 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -15,6 +15,21 @@ tdu() { | cut -c 1-115 } +# Top Disk-Using Files +tduf() { + find "$1" -type f -printf '%s\t%p\0' \ + | sort -z -n -k 1 -r \ + | head -z -n 50 \ + | gawk -v RS='\0' ' + { + size = $1 + path = $0 + sub("^" $1 "\t+", "", path) + gb = size / 1024 / 1024 / 1024 + printf("%f\t%s\n", gb, path) + }' +} + # Most-recently modified file system objects recent() { # NOTES: