From owner-freebsd-questions@FreeBSD.ORG Wed Dec 17 18:19:40 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 1A14B1065670 for ; Wed, 17 Dec 2008 18:19:40 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: from mx1.identry.com (on.identry.com [66.111.0.194]) by mx1.freebsd.org (Postfix) with ESMTP id A8CC78FC16 for ; Wed, 17 Dec 2008 18:19:39 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: (qmail 6062 invoked by uid 89); 17 Dec 2008 18:19:38 -0000 Received: from unknown (HELO ?192.168.1.110?) (jalmberg@75.127.142.66) by mx1.identry.com with ESMTPA; 17 Dec 2008 18:19:38 -0000 Mime-Version: 1.0 (Apple Message framework v753.1) In-Reply-To: <18761.15838.256303.685029@jerusalem.litteratus.org> References: <283ACBF4-8227-4A24-9E17-80A17CA2A098@identry.com> <7B241EE7-10A4-4BAA-9ABC-8DA5D4C1048B@identry.com> <18761.15838.256303.685029@jerusalem.litteratus.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5D4D65A5-2E5A-47D6-8829-CC69BA137C86@identry.com> Content-Transfer-Encoding: 7bit From: John Almberg Date: Wed, 17 Dec 2008 13:19:34 -0500 To: freebsd-questions@freebsd.org X-Mailer: Apple Mail (2.753.1) 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 18:19:40 -0000 > >>> 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. sorry... I meant du -h -d1 > 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 Thanks to everyone that suggested this. A much faster way to find the big offenders > > > 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. > And this is a great proactive measure. Thanks -- John