From owner-freebsd-questions@FreeBSD.ORG Fri Jan 4 17:18:59 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 146E716A41A for ; Fri, 4 Jan 2008 17:18:59 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 61E0613C4F4 for ; Fri, 4 Jan 2008 17:18:58 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) by smtp.infracaninophile.co.uk (8.14.2/8.14.2) with ESMTP id m04HIp6S090896; Fri, 4 Jan 2008 17:18:52 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.4.1 smtp.infracaninophile.co.uk m04HIp6S090896 Authentication-Results: smtp.infracaninophile.co.uk; dkim=hardfail (SSP) header.i=unknown Message-ID: <477E6A7B.3070207@infracaninophile.co.uk> Date: Fri, 04 Jan 2008 17:18:51 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.9 (X11/20071122) MIME-Version: 1.0 To: Paul Schmehl References: <179863EA8C3D6945412CA598@utd59514.utdallas.edu> In-Reply-To: <179863EA8C3D6945412CA598@utd59514.utdallas.edu> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (smtp.infracaninophile.co.uk [IPv6:::1]); Fri, 04 Jan 2008 17:18:52 +0000 (GMT) X-Virus-Scanned: ClamAV 0.92/5363/Fri Jan 4 13:37:27 2008 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on happy-idiot-talk.infracaninophile.co.uk Cc: FreeBSD Questions Subject: Re: Paging Matthew Seaman X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2008 17:18:59 -0000 -----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! > 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 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 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. 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. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHfmp78Mjk52CukIwRCBFOAJ4gMFtchgMczC9V8/MwpXrs00+L6QCfYwrU R8Kev8R9wg2gkbJsZCuCxwg= =djh7 -----END PGP SIGNATURE-----