From owner-freebsd-questions@freebsd.org Tue Dec 4 20:13:17 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A407E131B0F2 for ; Tue, 4 Dec 2018 20:13:17 +0000 (UTC) (envelope-from a199e59c87e914e7b5fdb9459865d66e@zxas.fi) Received: from box.zxas.fi (box.zxas.fi [IPv6:2a03:e581:4:e9::5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E76B70AD0 for ; Tue, 4 Dec 2018 20:13:16 +0000 (UTC) (envelope-from a199e59c87e914e7b5fdb9459865d66e@zxas.fi) Received: from authenticated-user (box.zxas.fi [185.87.108.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by box.zxas.fi (Postfix) with ESMTPSA id 47BFC81E80; Tue, 4 Dec 2018 22:13:14 +0200 (EET) Received: from authenticated-user (box.zxas.fi [185.87.108.237]) by zero.my.domain (Postfix) with ESMTP id 6666733C39; Tue, 4 Dec 2018 22:13:12 +0200 (EET) Received: from authenticated-user (box.zxas.fi [185.87.108.237]) by thunderbolt.my.domain (8.15.2/8.15.2) with ESMTPS id wB4KDAga065986 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 4 Dec 2018 22:13:10 +0200 (EET) (envelope-from ejk@thunderbolt.my.domain) Received: from authenticated-user (box.zxas.fi [185.87.108.237]) by thunderbolt.my.domain (8.15.2/8.15.2/Submit) id wB4KDAdk065985; Tue, 4 Dec 2018 22:13:10 +0200 (EET) (envelope-from ejk) Date: Tue, 4 Dec 2018 22:13:10 +0200 From: Esa Karkkainen To: Paul Schmehl Cc: freebsd-questions@freebsd.org Subject: Re: Files in / Message-ID: <20181204201310.GE52067@pp.htv.fi> Mail-Followup-To: Esa Karkkainen , Paul Schmehl , freebsd-questions@freebsd.org References: <66B63BE11669F00AA754FE87@Pauls-MacBook-Pro.local> <23558.33730.773326.914041@jerusalem.litteratus.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23558.33730.773326.914041@jerusalem.litteratus.org> X-Rspamd-Queue-Id: 9E76B70AD0 X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-0.99)[-0.993,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-0.98)[-0.985,0]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(0.51)[0.509,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[zxas.fi:~]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[zxas.fi,quarantine]; MX_GOOD(-0.01)[box.zxas.fi]; R_DKIM_PERMFAIL(0.00)[zxas.fi]; FORGED_SENDER(0.30)[freebsd.lists@zxas.fi,a199e59c87e914e7b5fdb9459865d66e@zxas.fi]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-0.02)[country: FI(-0.09)]; ASN(0.00)[asn:201057, ipnet:2a03:e581:4::/48, country:FI]; FROM_NEQ_ENVFROM(0.00)[freebsd.lists@zxas.fi, a199e59c87e914e7b5fdb9459865d66e@zxas.fi] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2018 20:13:17 -0000 On Tue, Dec 04, 2018 at 08:40:18AM -0500, Robert Huff wrote: > And - if you're trying to track down what's gobbling disk space - > try this, aimed at the suspect directory: > > du -k | sort -n -r | head -n 25 I'm using a variation of that du -axk / | sort -rn Which I usually redirect to a file, so I don't need to run the same command again and again. But I digress, the command will list every directory and file within the / filesystem, Each directory will contain sum of the files within, for example # du -axk / | sort -rn | head -2 1860504 / 1761543 /boot # df -k / Filesystem 1024-blocks Used Avail Capacity Mounted on tank/root 180339052 1860536 178478516 1% / # So df show usage of 1 860 536 KiB and df shows 1 860 504 KiB, difference of 32 KiB, the numbers will not match exactly. In this case there is a 0.000018% difference between disk usage shown by df and du. Second largest directory is /boot, sum of the file sizes within /boot directory is 1 761 543 KiB. The "du -axk" keeps du within one filesystem, so it will not wander to other filesystems like /proc, possibly /var, if it is a separate filesystem etc. The "sort -rn" sorts the lines, using the first column, sort order is largest to smallest number. Regards, Esa -- "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." -- Douglas Adams 1952 - 2001