Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Always do right. This will gratify some people and astonish the rest. -- Mark Twain


comp / comp.os.linux.misc / Re: Fun With The du Command

SubjectAuthor
* Fun With The du CommandLawrence D'Oliveiro
+- Re: Fun With The du CommandBorax Man
`- Re: Fun With The du Commandghodawalaaman

1
Subject: Fun With The du Command
From: Lawrence D'Oliv
Newsgroups: comp.os.linux.misc
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 01:52 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.os.linux.misc
Subject: Fun With The du Command
Date: Wed, 29 May 2024 01:52:12 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <v361ob$v652$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 29 May 2024 03:52:12 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="3ef20057ca595167e2155ab2d3a746a0";
logging-data="1022114"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19GkLRGUEOzJSDUISnBCtao"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:kR2YsN+dKPSj2/qMGeIWdQKS3T8=
View all headers

Looking at the space taken up by my copy of the Blender source code:

ldo@theon:projects> du -ks blender
1444272 blender

Most of that is in the commit history:

ldo@theon:projects> du -ks blender/.git
1139640 blender/.git

So how much isn’t?

ldo@theon:projects> du -ks blender/.git blender
1139640 blender/.git
304632 blender

Do you see what happened there? If you specify a directory, and then
its containing directory on the same command, du will subtract the
usage of the former from the latter. This gives you an easy way of
determining the space taken up by a directory, not including
particular subdirectories.

This can be broken down even more:

ldo@theon:projects> du -ks blender/.git blender/extern blender/intern blender/source blender
1139640 blender/.git
40536 blender/extern
15712 blender/intern
105188 blender/source
143196 blender

Here, “extern” is various open-source libraries from other sources,
that have been copied into the Blender source tree, while “intern” is
code that originated from Blender itself, that has been organized into
its own libraries. And as you can see, there is still a whole bunch
left in other subdirectories.

Does this work recursively?

ldo@theon:projects> du -ks blender/.git blender/intern/cycles blender/intern blender
1139640 blender/.git
8880 blender/intern/cycles
6832 blender/intern
288920 blender

Yes it does. Here we can see that the Cycles renderer makes up a bit
over half the contents of “intern”.

Subject: Re: Fun With The du Command
From: Borax Man
Newsgroups: comp.os.linux.misc
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 10:36 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rotflol2@hotmail.com (Borax Man)
Newsgroups: comp.os.linux.misc
Subject: Re: Fun With The du Command
Date: Wed, 29 May 2024 10:36:43 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <slrnv5e19r.bah.rotflol2@geidiprime.bvh>
References: <v361ob$v652$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 29 May 2024 12:36:44 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="edffdf212fe7c9036f978a34286b42e1";
logging-data="1168291"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Aat/kPEpUsneO1PPmZQKY1zW8rswzZzU="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:qE8rh6QuuYMPqaYDn7N3PWdTeYY=
View all headers

On 2024-05-29, Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> Looking at the space taken up by my copy of the Blender source code:
>
> ldo@theon:projects> du -ks blender
> 1444272 blender
>
> Most of that is in the commit history:
>
> ldo@theon:projects> du -ks blender/.git
> 1139640 blender/.git
>
> So how much isn’t?
>
> ldo@theon:projects> du -ks blender/.git blender
> 1139640 blender/.git
> 304632 blender
>
> Do you see what happened there? If you specify a directory, and then
> its containing directory on the same command, du will subtract the
> usage of the former from the latter. This gives you an easy way of
> determining the space taken up by a directory, not including
> particular subdirectories.
>
> This can be broken down even more:
>
> ldo@theon:projects> du -ks blender/.git blender/extern blender/intern blender/source blender
> 1139640 blender/.git
> 40536 blender/extern
> 15712 blender/intern
> 105188 blender/source
> 143196 blender
>
> Here, “extern” is various open-source libraries from other sources,
> that have been copied into the Blender source tree, while “intern” is
> code that originated from Blender itself, that has been organized into
> its own libraries. And as you can see, there is still a whole bunch
> left in other subdirectories.
>
> Does this work recursively?
>
> ldo@theon:projects> du -ks blender/.git blender/intern/cycles blender/intern blender
> 1139640 blender/.git
> 8880 blender/intern/cycles
> 6832 blender/intern
> 288920 blender
>
> Yes it does. Here we can see that the Cycles renderer makes up a bit
> over half the contents of “intern”.

Thats pretty cool!

You can acheive the same thing using the --exclude option, at least it works for the GNU option.

du -s --exclude="blender/.git" blender

will do the same.

Subject: Re: Fun With The du Command
From: ghodawalaaman
Newsgroups: comp.os.linux.misc
Organization: A noiseless patient Spider
Date: Wed, 24 Jul 2024 12:50 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ghodawalaaman@gmail.com (ghodawalaaman)
Newsgroups: comp.os.linux.misc
Subject: Re: Fun With The du Command
Date: Wed, 24 Jul 2024 12:50:37 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <v7qtar$1nv6h$2@dont-email.me>
References: <v361ob$v652$1@dont-email.me>
Injection-Date: Wed, 24 Jul 2024 14:50:38 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0b09851b604b3984cf6bf9dffeb940d9";
logging-data="1834193"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197fqgyqrPnRBQVTpIhHPlAYbbfNv4BGvE="
User-Agent: tin/2.6.4-20240224 ("Banff") (Linux/6.8.0-38-generic (x86_64))
Cancel-Lock: sha1:e7G2oXkFJaBtugQSvCrtZue+teE=
View all headers

Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
> Looking at the space taken up by my copy of the Blender source code:
>
> ldo@theon:projects> du -ks blender
> 1444272 blender
>
> Most of that is in the commit history:
>
> ldo@theon:projects> du -ks blender/.git
> 1139640 blender/.git
>
> So how much isn???t?
>
> ldo@theon:projects> du -ks blender/.git blender
> 1139640 blender/.git
> 304632 blender
>
> Do you see what happened there? If you specify a directory, and then
> its containing directory on the same command, du will subtract the
> usage of the former from the latter. This gives you an easy way of
> determining the space taken up by a directory, not including
> particular subdirectories.
>
> This can be broken down even more:
>
> ldo@theon:projects> du -ks blender/.git blender/extern blender/intern blender/source blender
> 1139640 blender/.git
> 40536 blender/extern
> 15712 blender/intern
> 105188 blender/source
> 143196 blender
>
> Here, ???extern??? is various open-source libraries from other sources,
> that have been copied into the Blender source tree, while ???intern??? is
> code that originated from Blender itself, that has been organized into
> its own libraries. And as you can see, there is still a whole bunch
> left in other subdirectories.
>
> Does this work recursively?
>
> ldo@theon:projects> du -ks blender/.git blender/intern/cycles blender/intern blender
> 1139640 blender/.git
> 8880 blender/intern/cycles
> 6832 blender/intern
> 288920 blender
>
> Yes it does. Here we can see that the Cycles renderer makes up a bit
> over half the contents of ???intern???.

This could be useful for me if I remember this command when I actually need it :)

Thank you for providing this useful information :D

1

rocksolid light 0.9.8
clearnet tor