summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomas grothe <grothe.tr@gmail.com>2023-11-12 22:27:21 -0600
committerthomas grothe <grothe.tr@gmail.com>2023-11-12 22:27:21 -0600
commit1692be1b54344b15550499ecd5d8a469b26187f0 (patch)
tree5ca04043c9ece4dc2ecd6cb2ab43f83403f65076
parent87544d9583a91529a7c5c1816dc1a06eabaf7cd0 (diff)
better cmd for finding biggest files
-rwxr-xr-xbig10
1 files changed, 8 insertions, 2 deletions
diff --git a/big b/big
index 0a24436..936d933 100755
--- a/big
+++ b/big
@@ -1,6 +1,12 @@
+d="."
+if [[ ${1} ]]; then d=${1}; fi
+
if [ -z ${2} ]; then
- du -a ${1} | sort -n -r | head -n 15
+ #du -a ${d} | sort -n -r | head -n 15
+ find ${d} -type f -exec du -Sh {} + | sort -rh | head -n 20
+ # use -not -path [dir] to exlude directories
else
- du -a ${1} | sort -n -r | head -n ${2}
+ #du -a ${1} | sort -n -r | head -n ${2}
+ find ${d} -type f -exec du -Sh {} + | sort -rh | head -n ${2}
fi