You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
648 B
38 lines
648 B
#!/bin/bash |
|
|
|
#Создан: Пт 26 фев 2016 21:32:55 |
|
#Изменён: Вс 02 авг 2020 14:33:02 |
|
|
|
#- Вывод размера файлов в отсортированном виде |
|
|
|
rstc="\033[00m" |
|
|
|
\du -sh -c -- "$@" | sort -rh | awk ' |
|
BEGIN { |
|
blue="\033[1;36m" |
|
green="\033[1;32m" |
|
red="\033[1;31m" |
|
yellow="\033[1;33m" |
|
} |
|
|
|
/^[0-9,]+G/ { printf("%s%10s",red,$1); } |
|
|
|
/^[0-9,]+M/ { |
|
mb=$1 |
|
sub("M","",mb) |
|
|
|
if (int(mb) > 500) { |
|
printf("%s%10s",yellow,$1) |
|
} else { |
|
printf("%s%10s",green,$1) |
|
} |
|
} |
|
|
|
/^[0-9,]+K/ { printf("%s%10s",blue,$1); } |
|
/^0/ { printf("%s%10s",blue,$1); } |
|
|
|
sub($1,"") |
|
' |
|
|
|
echo -e -n "$rstc" |
|
|
|
|