From 858aa230f2493864905e56c5c89a9a0225db24da Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Fri, 10 Jan 2020 14:29:31 -0500 Subject: [PATCH] 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. --- home/lib/login_functions.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 -- 2.20.1