Reverse display order for largest files/dirs
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 10 Jan 2020 19:29:31 +0000 (14:29 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 10 Jan 2020 19:29:31 +0000 (14:29 -0500)
so that I don't have to scroll up to see the largest even when using a
small screen.

home/lib/login_functions.sh

index 1eaf4d6..5cb3709 100644 (file)
@@ -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
This page took 0.024098 seconds and 4 git commands to generate.