Doug Stewart on 20 Apr 2016 18:44:25 -0700


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

Re: [PLUG] Good tools to assay disk usage in linux


I've dated and updated DiskHog.pl over the years:

Yes it's from 1997, but thanks be to Larry Wall, Perl 5 still interprets it just fine. 


--
Doug Stewart

On Apr 20, 2016, at 8:36 PM, Fred Stluka <fred@bristle.com> wrote:

PLUGgers,

I wrote "dubig" a while.  Finds all files/dirs in the tree with more
than the specified number of digits of 1K blocks.  To find all files
or dirs 1000K or bigger I type:
% dubig 4

for 100,000K or bigger:
% dubig 6

It basically does:
du -ck | grep -E "^[0-9]{n,}"

See:
- http://bristle.com/Tips/Unix.htm#csh_script_dubig

--Fred
------------------------------------------------------------------------
Fred Stluka -- mailto:fred@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
------------------------------------------------------------------------
On 4/20/16 11:57 AM, Gavin W. Burris wrote:
Nice.  You can get rid of awk:
alias bigfiles='find . -ls |sort -rn -k7 |head -10'

Usually, I just use this for the current dir:
alias sizes='du -s * .[a-zA-Z0-9]* -c |sort -n'

Here's a fancier one, cli bar graph included:
alias bars='du -x --max-depth=1|sort -rn|awk -F / -v c=$COLUMNS '"'"'NR==1{t=$1}NR>1{r=int($1/t*c+.5); b="\033[1;31m"; for (i=0; i<r; i++) b=b"#"; printf " %5.2f%% %s\033[0m %s\n", $1/t*100, b, $2}'"'"'|tac'

Cheers.


On Wed 04/20/16 11:19AM EDT, Andy Wojnarek wrote:
I use:

Andrews-MacBook-Pro:/ root# find . -ls 2>/dev/null | awk '{ print $7 " " $NF }' | sort -rn | head -5
5706997760 ./Users/awojnarek/Downloads/VMware-OpenStack-2.0.0.0-3717954_OVF10.ova
3438788608 ./System/Library/Caches/com.apple.coresymbolicationd/data
1315634608 ./Library/Updates/031-53822/OSXUpd10.11.4Patch.pkg
1150844928 ./Users/awojnarek/sft/ubuntu-15.04-desktop-amd64.iso
1073741824 ./private/var/vm/sleepimage

I like using find command, it’s quicker than du.


Thanks,
Andrew Wojnarek |  Sr. Systems Engineer    | ATS Group, LLC


On Apr 20, 2016, at 11:14 AM, JP Vossen <jp@jpsdomain.org<mailto:jp@jpsdomain.org>> wrote:

I used to use `du -hl <various>` a lot until I found `ncdu` which is a curses-based CLI tool.  The awesome part is that it walks the tree first, then you can navigate around instantly, to see what's what.  It's in the repos for Debuntu-like systems.

`man ncdu` and see "-x" and  "--exclude-caches" also.


If that doesn't work, here are some other clues:
http://dev.yorhel.nl/ncdu/
* gt5 - Quite similar to ncdu, but a different approach.
* tdu - Another small ncurses-based disk usage visualization utility.
* TreeSize - GTK, using a treeview.
* Baobab - GTK, using pie-charts, a treeview and a treemap. Comes with GNOME.
* GdMap - GTK, with a treemap display.
* Filelight - KDE, using pie-charts.
* KDirStat - KDE, with a treemap display.
* QDiskUsage - Qt, using pie-charts.
* xdiskusage - FLTK, with a treemap display.
* fsv - 3D visualization.
* Philesight - Web-based clone of Filelight.


On 04/20/2016 10:56 AM, Michael Lazin wrote:
I often use "du -sh ./*" to see what directory in a webspace uses the
most space.  This will list the size of each directory you are in in
human readable format.  If you want something fancier let me know.  I
can probably point you in the right direction.

On Wed, Apr 20, 2016 at 10:54 AM, Paul Walker <pjwalker76@gmail.com
<mailto:pjwalker76@gmail.com>> wrote:

   Looking for good command line tools for assaying disk usage. I'd
   like to be able to crawl the disk down to an arbitrary depth and
   output the size of each directory. I don't really want to write too
   much bash in the process! Any good goto tools you could share?

Later,
JP
--  -------------------------------------------------------------------
JP Vossen, CISSP | http://www.jpsdomain.org/ | http://bashcookbook.com/
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug


___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug