On Sun, Jan 12, 2003 at 02:15:29PM +0200, Tzafrir Cohen wrote: > On Sun, 12 Jan 2003, Oded Arbel wrote: > > > On Sunday 12 January 2003 10:57, Shoshannah Forbes wrote: > > > > > Is there any utility out there that can help me figure out what is > > > using all my HD space and what can be removed safely, without making a > > > mess? > > > > An automated one ? not that I can recall. > > but you can always use `du -Hs` to look at each directory's disk usage and see > > where you waste all the space and then decide if you want to delete it. > > My 2c: > > du -scH /path/to/check/* > > ('H' is optional. It will somnetimes make the output more readable, but > sometimes 'k' or nothing at all will give you a better idea, because "32M" > and "323" don't look very different) > > or: > du -scH /ath/to/check/* |sort -n > > Then you find the subdirs with most content, and see which of their > subdirs takes everything, with a command similar to the above.
I will add my own 2c: I usually do du /path/to/check | awk '$1>10000' or even du /path/to/check | awk '$1>10000' | sort -n This will output you all the directories (including deep ones) with more than 10MB (optionally sorted). I usually don't sort, because on a large tree I don't have patience to wait, and sort needs the entire input before it sorts (as opposed to awk). > > A note about performance: Typically the first time you run 'du' (with > whatever switches) on a certain subtree it will read the file siszes of > all the files from the disk, and thus will take relatively long. But on > later runs you can generally expect for the relevant data (the inodes, in > this case) to remain in the cache, and thus any further runs on the same > tree or a subtree are expected to take a much shorter time. This won't help much over NFS. On NFS, I usually do du /path/to/check > /tmp/somefile and then do on it awk, sort -n, etc. > > -- > Tzafrir Cohen > mailto:[EMAIL PROTECTED] > http://www.technion.ac.il/~tzafrir > > > ================================================================= > To unsubscribe, send mail to [EMAIL PROTECTED] with > the word "unsubscribe" in the message body, e.g., run the command > echo unsubscribe | mail [EMAIL PROTECTED] Didi ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]