home
/
code
/
khome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f13f270
)
Add function to find top disk-using files
author
Siraaj Khandkar
<siraaj@khandkar.net>
Tue, 23 Apr 2019 15:07:18 +0000
(11:07 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Tue, 23 Apr 2019 15:07:18 +0000
(11:07 -0400)
home/lib/login_functions.sh
patch
|
blob
|
blame
|
history
diff --git
a/home/lib/login_functions.sh
b/home/lib/login_functions.sh
index
13a2ba2
..
9b8b863
100644
(file)
--- 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:
This page took
0.018128 seconds
and
4
git commands to generate.