From: vallor@vallor.earth   
      
   At Mon, 6 Oct 2025 10:02:20 -0000 (UTC), Dan Purgert    
   wrote:   
      
   > On 2025-10-06, RobH wrote:   
   > > On 06/10/2025 01:11, Alan K. wrote:   
   > >> On 10/5/25 7:36 PM, vallor wrote:   
   > >>> Good advice.   
   > >>>   
   > >>> There's also the -S option to du, which totals up   
   > >>> usage in directories. So:   
   > >>>   
   > >>> sudo du -Sx / > /tmp/d.sizes   
   > >>>   
   > >>> Then:   
   > >>>   
   > >>> sort -rn /tmp/d.sizes > /tmp/sorted.d.sizes   
   > >>>   
   > >>> head /tmp/sorted.d.sizes   
   > >>>   
   > >>> The "-x" in "du -Sx" means to stay on the same filesystem,   
   > >>> so if /home is separate, you'll need to repeat the process   
   > >>> there.   
   > >>   
   > >> Simplified without creating the file:   
   > >> sudo du -Sx / | sort -rn | head -20   
   > >>   
   > > Pardon me fore asking, but what do the 6 and 7 figure numbers mean   
   > > on the left hand side when it lists the folders etc.   
   >   
   > It's the file-size. I *believe* it is in blocks on your drive; so the   
   > numbering will be dependent on your filesystem (e.g. here I have 4K   
   > blocks, so a 13K file shows as "4"; but if you have 512B blocks, it   
   > would be 26).   
      
    From the man page:   
    Display values are in units of the first available SIZE from   
    --block-size, and the DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE   
    environment variables. Otherwise, units default to 1024   
    bytes (or 512 if POSIXLY_CORRECT is set).   
      
   So basically, it's in Kbytes, as in units of 1024 bytes.   
      
   (Sidenote: I can never remember if that's supposed to be   
   "POSIXLY_CORRECT" or "POSIX_CORRECTLY".)   
      
   --   
   -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090Ti 24G   
    OS: Linux 6.17.0 D: Mint 22.2 DE: Xfce 4.18   
    NVIDIA: 580.95.05 Mem: 258G   
    "Bugs are Sons of Glitches!"   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|