On Thu, Mar 06, 2025 at 23:36:34 -0500, Stefan Monnier wrote:
> David Christensen [2025-03-06 18:58:12] wrote:
> > I prefer:
> [...]
> > # du -d 2 -m /var | sort -rn | head
> 
> Agreed.  I personally use just `du | sort -n` (I can't see the benefit
> of the `-d2` and I rely on the terminal's scrolling to filter out the
> small fry instead of using `-r` and `head`).
> But indeed, the `-m` is a good idea, thanks (never bothered to look for
> such a thing).

Yeah, I didn't know about -m either.  I know about -k because I come
from a commercial Unix background, where we have:

DU(1POSIX)                 POSIX Programmer's Manual                DU(1POSIX)

SYNOPSIS
       du [-a|-s] [-kx] [-H|-L] [file...]

and that's it.  In such an environment, I might use something like

    du -sk * | sort -n

and just live with the much larger numbers that are printed.
(I agree with the "let the terminal scroll the little ones away"
approach, by the way.  As long as you're not accessing the system
over a slow connection.)

However, when giving advice to Maureen, I wasn't trying to give her
a complicated recipe.  I was trying to give her *simple* commands
that she could use to investigate her system and find where the
space was being used.  (Good thing I didn't go complicated, either,
as it turned out she even messed up "du -sh *".)

Reply via email to