From owner-freebsd-questions Tue Jan 8 15:14:24 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id F3A8137B41F for ; Tue, 8 Jan 2002 15:14:16 -0800 (PST) Received: from hades.hell.gr (patr530-a233.otenet.gr [212.205.215.233]) by mailsrv.otenet.gr (8.11.5/8.11.5) with ESMTP id g08NECm16948; Wed, 9 Jan 2002 01:14:13 +0200 (EET) Received: (from charon@localhost) by hades.hell.gr (8.11.6/8.11.6) id g08NE4o77801; Wed, 9 Jan 2002 01:14:05 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Wed, 9 Jan 2002 01:14:04 +0200 From: Giorgos Keramidas To: Anthony Atkielski Cc: questions@freebsd.org Subject: Re: How do I find major consumers of disk space on the system? Message-ID: <20020108231404.GA77687@hades.hell.gr> References: <008301c17af1$910f4a90$0a00000a@atkielski.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <008301c17af1$910f4a90$0a00000a@atkielski.com> User-Agent: Mutt/1.3.23.2i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2001-12-02 06:24:01, Anthony Atkielski wrote: > I see that there are lots of commands that tell me various things about the > filesystems I have mounted and what is on them, but what is the best command or > commands to use in order to locate the parts of the file hierarchy that are > taking up the most disk space? For example, I have 1.3 GB in use on the /usr > filesystem; how can I find out which directories are using the most space > (mainly with an eye to deleting stuff that doesn't really need to be there)? Since nobody else seems to have replied (or I missed the reply), here's a hint: # du -sk bin lib 11586 bin 39664 lib With du(1) and the -s option (only print the sum, and not every subdirectory), you can use the following commands to find where under /usr your space has gone. # cd /usr # du -sk * This will show only the first level of /usr subdirs. If you want to see second level directories too, you can use either: # cd /usr # du -sk * */* | sort or do other combinations of du/find/grep/sort like for example: # echo * */* | xargs file | grep 'directory$' | sed -e 's/:.*$//' | xargs du -sk | sort | more (Note: This might take a while to finish.) - Giorgos To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message