coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: du feature


From: Bernhard Voelker
Subject: Re: du feature
Date: Sun, 31 Jan 2016 13:26:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 01/31/2016 04:05 AM, Andrew Zwieg wrote:
> 
> I'd like to request a feature for coreutils, specifically 'du'. I have a 
> situation where root(/)  typically fills up alot(It would be easier to change 
> this situation, however that's not an option), So what i'm left with is if 
> you do du -sh /*, it makes a mess when it gets to /home if you have root 
> squashed home directories. It would be really nice to have an exclude flag, 
> such as '-e' to exclude /home, or other directories. 
> 
> I'm aware we can do something similar with find, in a rather un-easy syntax 
> to remember, and 3 pipes; it seems this is more appropriate in the 'du' tool. 
> I took a look over the rejected feature request, and found the below link, It 
> appears to be a different than the feature I'm requesting, because of the 
> nature of wanting to ignore the size, not the directory itself.  
> http://lists.gnu.org/archive/html/coreutils/2013-04/msg00043.html
> 
> 
> looking forward to you feedback.

If I understand you correctly, then you want a combination of

  -d, --max-depth=N     print the total for a directory (or file, with --all)
                          only if it is N or fewer levels below the command
                          line argument;  --max-depth=0 is the same as
                          --summarize
and

  -x, --one-file-system    skip directories on different file systems

right?

  $ du -xh -d1 /
  6.8G    /usr
  1.4M    /srv
  1.2G    /tmp
  16K     /lost+found
  34M     /etc
  11M     /root
  18M     /lib64
  6.1G    /var
  4.0K    /mnt
  4.0K    /opt
  4.0K    /selinux
  4.8M    /bin
  392M    /lib
  55M     /boot
  28K     /media
  9.1M    /sbin
  12K     /dir
  12K     /dir2
  15G     /

  $ df -h /
  Filesystem      Size  Used Avail Use% Mounted on
  /dev/sda2        20G   15G  4.1G  79% /

FWIW, you may also be interested in the --threshold option, e.g.:

  $ du -hx -d3 -t +3G /
  6.8G    /usr
  3.1G    /var/tmp/build-root
  4.7G    /var/tmp
  6.1G    /var
  15G     /

Have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]