Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jan 2008 13:35:56 -0500
From:      Jerry McAllister <jerrymc@msu.edu>
To:        Paul Schmehl <pauls@utdallas.edu>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Paging Matthew Seaman
Message-ID:  <20080104183556.GC19087@gizmo.acns.msu.edu>
In-Reply-To: <4133784D8828510FCCC00532@utd59514.utdallas.edu>
References:  <179863EA8C3D6945412CA598@utd59514.utdallas.edu> <477E6A7B.3070207@infracaninophile.co.uk> <4133784D8828510FCCC00532@utd59514.utdallas.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 04, 2008 at 12:03:51PM -0600, Paul Schmehl wrote:

> --On Friday, January 04, 2008 17:18:51 +0000 Matthew Seaman 
> <m.seaman@infracaninophile.co.uk> wrote:
> 
> >-----BEGIN PGP SIGNED MESSAGE-----
> >Hash: SHA256
> >
> >Paul Schmehl wrote:
> >>I figure if anyone knows the answer to this off the top of their head,
> >>Matthew will.
> >
> >Fame at last!
> >
> 
> Oh, you've been famous for a while here.  :-)
> 
> >>I've been reading the man pages for du and df, but I can't find the
> >>right combination.  I'd like to get the type of output that df -h gives
> >>you but only for one mount point or even one directory.  Is there a tool
> >>that can do that? (IOW, I'd like to run du -h but only get the totals
> >>for directories.)
> >
> >Well, for a mount point, the command that will give you output like
> >'df -h' for a specific partition is (*ta da*) 'df -h' -- tell it a
> >file or directory and it will tell you all about the partition that
> >lives on:
> >
> >% df -h /tmp
> >Filesystem    Size    Used   Avail Capacity  Mounted on
> >/dev/md0      248M     22K    228M     0%    /tmp
> >
> 
> This only returns the totals for mount points, however.  Not what I was 
> looking for.
> 
> >For an arbitrary directory, I assume you want the du(1) style total
> >space usage figures but in the 'human readable' style?  'du -hs' does
> >that if you tell it the directory name:
> >
> >% du -hs /tmp
> > 22K    /tmp
> >
> 
> You are more adept at understanding man pages than I.  I didn't "get" the 
> -s switch.  However, it only returns the single file or directory that I 
> specify. It's closer to what I wanted than df but not quite there.
> 
> >As others have suggested else thread, there are a variety of cunning
> >find + xargs combinations for generating a list of directories and
> >feeding the list into du(1) automatically.
> >
> 
> Yes, and I've concluded that's probably the only way I'm going to get what 
> I want.
> 
> >But all this seems to me to be pretty clearly explained in the du(1)
> >and df(1) man pages so I've probably completely misunderstood what you
> >are actually asking for.
> >
> 
> Nope.  You understood.
> 
> Thanks to everyone that responded.  I'll tweak the suggestions until I get 
> what I want or some near equivalent of it.

I may be missing what you want, but I try CDing to the directory
and then doing the du -hs *    eg
  cd /tmp
  du -hs *

It seems to get it when naming the directory doesn't.

////jerry


> 
> -- 
> Paul Schmehl (pauls@utdallas.edu)
> Senior Information Security Analyst
> The University of Texas at Dallas
> http://www.utdallas.edu/ir/security/
> 
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080104183556.GC19087>