Kleines Treesize Bash Skript
Ich Gebe euch mal ein kleines Bash Skript:
Vielleicht Hilft es jemandem Viel Spass damit
#/bin/sh
du -k --max-depth=1 | sort -nr | awk '
BEGIN {
split("KB,MB,GB,TB", Units, ",");
}
{
u = 1;
while ($1 >= 1024) {
$1 = $1 / 1024;
u += 1
}
$1 = sprintf("%.1f %s", $1, Units[u]);
print $0;
}
'
Vielleicht Hilft es jemandem Viel Spass damit
Please also mark the comments that contributed to the solution of the article
Content-Key: 274932
Url: https://administrator.de/contentid/274932
Printed on: April 23, 2024 at 09:04 o'clock
1 Comment
ODER man macht mal ein Update seiner uralten Distribution und lässt
Nettes Skript, aber wirklich gebraucht wird das nicht mehr.
Vergleich:
du
und sort
mit -h
laufen.Nettes Skript, aber wirklich gebraucht wird das nicht mehr.
Vergleich:
treesize.scr | du -chs *|sort -h |
---|---|
./tree.scr | du -chs *|sort -h |