From owner-freebsd-questions@FreeBSD.ORG Fri Jan 4 20:03:26 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 0A0EC16A418 for ; Fri, 4 Jan 2008 20:03:26 +0000 (UTC) (envelope-from rmarella@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181]) by mx1.freebsd.org (Postfix) with ESMTP id D023613C4D5 for ; Fri, 4 Jan 2008 20:03:25 +0000 (UTC) (envelope-from rmarella@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so11116815waf.3 for ; Fri, 04 Jan 2008 12:03:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type:content-transfer-encoding; bh=5e8o6fIUHHvO9v8ZbzoAUpaWnjCMfpYWAuZ249a4flk=; b=B5bF/b2Kte5rxAhirRycBSQyFzps0cYk6KrT4kSIKmGCYUkusFwPd2fArZMM+8c7Ggw/nvUzXUbzCWsXuOXXAKpPA29gqoQhz2f88ObBZ28E9qQAf9f5h1+UCmsTb04+F2tQrIvyYi3qBLqZfTQLKksnD+SrP8lBBlDvc1QZYq8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer:mime-version:content-type:content-transfer-encoding; b=MIKx8zZNxr+6rU2CCnIv7E8U54cziiB6ITI8DC8BzLPoqVnAg0Qjp4f9JCobFYSMRswRq5aJQqivb/1sYUhJL7B+PMIFcWYMRnLl7oHAnCX4jdhW4kmYNq5DbWoff0/ufpxw1uFZTPPGrxCAgo6xTHOSTYBYQ6ykDV/GcT+Hp00= Received: by 10.115.15.1 with SMTP id s1mr1409223wai.0.1199477005433; Fri, 04 Jan 2008 12:03:25 -0800 (PST) Received: from asus64 ( [66.75.108.9]) by mx.google.com with ESMTPS id t1sm27174540poh.0.2008.01.04.12.03.22 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2008 12:03:24 -0800 (PST) Date: Fri, 4 Jan 2008 10:03:18 -1000 From: Robert Marella To: Paul Schmehl Message-ID: <20080104100318.682674a6@asus64> In-Reply-To: <39F9F75310345050CED25674@utd59514.utdallas.edu> References: <179863EA8C3D6945412CA598@utd59514.utdallas.edu> <477E6A7B.3070207@infracaninophile.co.uk> <4133784D8828510FCCC00532@utd59514.utdallas.edu> <20080104183556.GC19087@gizmo.acns.msu.edu> <39F9F75310345050CED25674@utd59514.utdallas.edu> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.3; amd64-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 20:03:26 -0000 On Fri, 04 Jan 2008 13:30:00 -0600 Paul Schmehl wrote: > --On Friday, January 04, 2008 13:35:56 -0500 Jerry McAllister > wrote: > > > On Fri, Jan 04, 2008 at 12:03:51PM -0600, Paul Schmehl wrote: > > > >> --On Friday, January 04, 2008 17:18:51 +0000 Matthew Seaman > >> 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. > > > > Thanks, Jerry. This turns out to be quite useful - actually a better > solution than what I had in mind. > No need to cd. du -hs /tmp/*