From: Siraaj Khandkar Date: Fri, 10 Jan 2020 19:29:31 +0000 (-0500) Subject: Reverse display order for largest files/dirs X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=858aa230f2493864905e56c5c89a9a0225db24da;p=khome.git Reverse display order for largest files/dirs so that I don't have to scroll up to see the largest even when using a small screen. --- diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index 1eaf4d6..5cb3709 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -140,8 +140,8 @@ top_commands() { # TODO: Consider using numfmt instead of awk tdu() { du "$1" \ - | sort -n -k 1 -r \ - | head -50 \ + | sort -n -k 1 \ + | tail -50 \ | awk ' { size = $1 @@ -156,8 +156,8 @@ tdu() { # Top Disk-Using Files tduf() { find "$1" -type f -printf '%s\t%p\0' \ - | sort -z -n -k 1 -r \ - | head -z -n 50 \ + | sort -z -n -k 1 \ + | tail -z -n 50 \ | gawk -v RS='\0' ' { size = $1