| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | brt_du() { |
| 4 | local path="${1:-.}" |
| 5 | local depth="${2:-1}" |
| 6 | |
| 7 | if [[ ! -e "$path" ]]; then |
| 8 | brt_error "Path not found: ${path}" |
| 9 | exit 1 |
| 10 | fi |
| 11 | |
| 12 | brt_info "Disk usage for ${path}:" |
| 13 | du -h -d "$depth" "$path" 2>/dev/null | sort -hr | head -20 |
| 14 | } |
| 15 | |