From owner-freebsd-questions@FreeBSD.ORG Wed Dec 17 17:59:00 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 AC1611065672 for ; Wed, 17 Dec 2008 17:59:00 +0000 (UTC) (envelope-from roberthuff@rcn.com) Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102]) by mx1.freebsd.org (Postfix) with ESMTP id 667B98FC13 for ; Wed, 17 Dec 2008 17:59:00 +0000 (UTC) (envelope-from roberthuff@rcn.com) Received: from mr02.lnh.mail.rcn.net ([207.172.157.22]) by smtp02.lnh.mail.rcn.net with ESMTP; 17 Dec 2008 12:58:59 -0500 Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr02.lnh.mail.rcn.net (MOS 3.8.6-GA) with ESMTP id PIE65314; Wed, 17 Dec 2008 12:58:58 -0500 (EST) Received: from unknown (HELO jerusalem.litteratus.org.litteratus.org) ([209.6.22.188]) by smtp01.lnh.mail.rcn.net with ESMTP; 17 Dec 2008 12:58:55 -0500 From: Robert Huff MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18761.15838.256303.685029@jerusalem.litteratus.org> Date: Wed, 17 Dec 2008 12:58:54 -0500 To: John Almberg In-Reply-To: <7B241EE7-10A4-4BAA-9ABC-8DA5D4C1048B@identry.com> References: <283ACBF4-8227-4A24-9E17-80A17CA2A098@identry.com> <7B241EE7-10A4-4BAA-9ABC-8DA5D4C1048B@identry.com> X-Mailer: VM 7.17 under 21.5 (beta28) "fuki" XEmacs Lucid X-Junkmail-Whitelist: YES (by domain whitelist at mr02.lnh.mail.rcn.net) Cc: freebsd-questions@freebsd.org Subject: Re: How to find files that are eating up disk space 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: Wed, 17 Dec 2008 17:59:00 -0000 John Almberg writes: > > Is there a command line tool that will help me figure out where the > > problem is? > > I should probably have mentioned that what I currently do is run > > du -h -d0 / > > and gradually work my way down the tree, until I find the > directory that is hogging disk space. This works, but is not > exactly efficient. "-d0" limits the search to the indicated directory; i.e. what you can see by doing "ls -al /". Not superior to "ls -al /" and using the Mark I eyeball. What (I think) you want is "du -x -h /": infinite depth, but do not cross filesystem mount-points. This is still broken in that it returns a list where the numbers are in a fixed-width fiend which are visually distinguished only by the last letter. Try this: du -x / and run the resu;ts through "sort": sort -nr and those results through "head": head -n 20 I have a cron job which does this for /usr and e-mails me the output every morning. After a few days, weeks at most, I know what should be on that list ... and what shouldn't and needs investigating. Robert Huff