From unknown Mon Aug 11 21:12:50 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#42471 <42471@debbugs.gnu.org> To: bug#42471 <42471@debbugs.gnu.org> Subject: Status: du --include Reply-To: bug#42471 <42471@debbugs.gnu.org> Date: Tue, 12 Aug 2025 04:12:50 +0000 retitle 42471 du --include reassign 42471 coreutils submitter 42471 jazz.com@gmail.com severity 42471 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 21 20:02:04 2020 Received: (at submit) by debbugs.gnu.org; 22 Jul 2020 00:02:04 +0000 Received: from localhost ([127.0.0.1]:40676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jy2Cw-0005Ok-6h for submit@debbugs.gnu.org; Tue, 21 Jul 2020 20:02:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:39790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jy1DB-0003tS-7X for submit@debbugs.gnu.org; Tue, 21 Jul 2020 18:58:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jy1DA-0005UA-V0 for bug-coreutils@gnu.org; Tue, 21 Jul 2020 18:58:12 -0400 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:33520) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jy1D8-0002wm-TU for bug-coreutils@gnu.org; Tue, 21 Jul 2020 18:58:12 -0400 Received: by mail-lj1-x22f.google.com with SMTP id e8so473301ljb.0 for ; Tue, 21 Jul 2020 15:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:from:date:message-id:subject:to; bh=fH0bxlR5XisuapnFiEldzfZSULhpiWGYPduIbtantiA=; b=jW2FVLGtfg76ss8EeYBlaGjUBrrUDo6vAWwU452BRjUfEEfdqhIy5DMj/PnYttsFSn zMS84Hb3fYQxjU9ndxUg49KDljdUnoc5JAa6kj8tuv6m5FMMs8mIdDjuSduaC13uonwv /KTInbRL8ZNPTla5bTkV9pykZp0ftgeI1FeJo7jFTcOkSbs536UNgVBnItgo02R4xK5B J3m70lPSYjy6/wQvwvfgiuw6sxYCRxxBFvycpNJ6sIpG5zD5et9FSH+w3GgGnwWS4oak POoD2vkdLq3ZqeFpXVa5JbQJAskc6C48e4uNxwx0/YTAcpg2OqjsJ8eNHP1mmqNU1g9Q bomw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=fH0bxlR5XisuapnFiEldzfZSULhpiWGYPduIbtantiA=; b=O6QwxOEBijoVz93Ca5Y829Tvgcq54dwozv/GE+XEdg1vIzcv06q43rmLGp6OVQzc+5 kGl3XZIzSCN2xLraABuFWahg/69AW2PyEkuaLtOVjkd5vV9NxlGx/nvHWehn3hfhG+og NY9ux2G8i8zBjGz7Q8Oa295dmX2+7oczDR9/OTjQ4JphFvRMQv3C1P4SvJygcebLil/d NLwgcRu//23tyjcd90jHt5+cuqwTYqIAtlFFRqGw/G7zZyjf9DhccfdoQNmL0L+g8ybr MhGmB3OxF7tXREXdGUBqiq9LzM1rDlpuHGQXwUiVb6H4n2DXTSuStHX+j+VEeVTTqZZb Wfzg== X-Gm-Message-State: AOAM531OUDGT0htyFA7hw1QWuadfE9+WLrQG5Bn+qvF0nLnw0iqjZ3aB Q+Ch1W2r7GIvH09oiA6px2YlxZpQoovnFIPptvNdJ107 X-Google-Smtp-Source: ABdhPJyNa0wOz/yGjDHyHw2qK/nIR94jYgPd6zw/ed8JvwMJcTeuY273KuImSQg23XPsuk/T/TukgiqmjZR4ksU3n9I= X-Received: by 2002:a2e:5806:: with SMTP id m6mr12449245ljb.23.1595372287834; Tue, 21 Jul 2020 15:58:07 -0700 (PDT) MIME-Version: 1.0 From: Jasmin Zainul Date: Wed, 22 Jul 2020 00:57:31 +0200 Message-ID: Subject: du --include To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary="000000000000803f5305aafb8e07" Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=jazz.com@gmail.com; helo=mail-lj1-x22f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 21 Jul 2020 20:02:01 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jazz.com@gmail.com Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --000000000000803f5305aafb8e07 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, I'd like to present my idea as a feature request for 'du' command. I've been asked several times to count certain file types within a given structure and present the data per each directory and in total (total size per each directory by counting given file types only). E.g. how many LibreOffice documents there are in /home directory, or how many archives are larger than 10MB, or how many video files etc. - and all lists should be sorted by size per each directory and in total. Later on, I've noticed I am in constant need as well for analyzing my own file structure similarly, e.g. to list all images by size in order to check if there's any content that needs to be optimized. Find command has a power for some of those tasks, but mostly it seems like a perfect fit for "du --include", since "du --exclude" already exists. E.g. currently, du can tell me a disk usage for all types of content inside of each directory, but I can not filter out such reports only for certain content types that I need to monitor. I was looking for a tool to quickly achieve this, but surprisingly, there's nothing out there I could find that would suit those demands nicely. So, I created my own script. It's called wii: https://github.com/madjoe/wii It could resolve every single task I described from above and it serves me quite well almost on a daily basis now: *Examples:* # lists all image files recursively with individual stats per each subdirectory $ wii -i # lists all archives etc. $ wii -r # lists all custom file types $ wii -x "php css js" # integration of arguments that should be passed to find command $ wii -c "-type f -mtime -7 -size +2M -name '*log*'" A few use-cases: - You know what you're looking for, but don't have any idea where it could be or what's the name of it. All you know is that you're looking for a video file somewhere within a certain directory tree, and there should also be tons of some PowerPoint documents as well. 1. $ wii -vd - You may assume that your archives and images are eating lots of disk space, so you need to check the structure recursively to see the exact numbers and make a decision which files to delete, or move to a differen= t location. 1. $ wii -G0 -ri - You=E2=80=99d like to check very quickly how many PDF's are stored wit= hin multiple directories and how much of total disk space only those files occupy. 1. $ wii -x "pdf" - Before you upload a new version of your website, you may want to check if some of the images are too heavy and need to be optimized. 1. $ wii -G0 -i - Recently you updated your system and now you=E2=80=99d like to list al= l the files max. a week old that are larger than e.g. 30MB each. Also, you=E2= =80=99d like to sum the results per each directory and see a total summary. 1. $ wii -c "-type f -size +30M -mtime -7" - In all of the examples from above, there would be =E2=80=9Ctotal=E2=80= =9D visible at the bottom of each list, where you could check how many of those files share the same filename, which may indicate unwanted duplicates. Please let me know what you think. Thanks in advance! Cheers, Jasmin Zainul --000000000000803f5305aafb8e07 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I'd like to present my idea as = a feature request for 'du' command. I've been asked several tim= es to count certain file types within a given structure and present the dat= a per each directory and in total (total size per each directory by countin= g given file types only). E.g. how many LibreOffice documents there are in = /home directory, or how many archives are l= arger than 10MB, or how many video files etc. - and all lists should be sor= ted by size per each directory and in total.

Later= on, I've noticed I am in constant need as well for analyzing my own fi= le structure similarly, e.g. to list all images by size in order to check i= f there's any content that needs to be optimized. Find command has a po= wer for some of those tasks, but mostly it seems like a perfect fit for &qu= ot;du --include", since "du --exclude" already exists.
=

E.g. currently, du can tell me a disk usage for all typ= es of content inside of each directory, but I can not filter out such repor= ts=C2=A0only for certain content types that I need to monitor.
I was looking for a tool to quickly achieve this, but surprisi= ngly, there's nothing out there I could find that would suit those dema= nds nicely.

So, I created my own script. It= 9;s called wii:=C2=A0https://gith= ub.com/madjoe/wii

It could resolve every singl= e task I described from above and it serves me quite well almost on a daily= basis now:

Examples:
# lists all image files recursively with individual stats pe= r each subdirectory
$=C2=A0wi= i -i
# lists all archives etc.
$=C2=A0wii -r
=
# lists all custom file types
$=C2=A0wii -x "php css js&quo= t;

# integration of arguments that should be passed to f= ind command
= $ wii -c "-type f -mtime -7 -size +2M -name '*log*'"


A few=C2=A0use-cases:

  • You know what you're looking for, but=C2=A0don't have any idea where it could be or what's the na= me of it. All you know is that you're looking for a video file s= omewhere within a certain directory tree, and there should also be tons of = some PowerPoint documents as well.
  1. $ wii -vd
  • You may assume that your archives and images are=C2=A0eating lots of disk space, so you need to c= heck the structure recursively to see the exact numbers and make a decision= which files to delete, or move to a different location.
  1. $ wii -G0 -ri
  • You=E2=80=99d like to check very quic= kly how many PDF's are stored within multiple directories and=C2=A0how much of total disk space only those files= occupy.
  1. $ wii -x &= quot;pdf"
  • Before you upload a new version of your website, you may want to ch= eck if=C2=A0some of the images are too he= avy and need to be optimized.
  • $ wii -G0 -i
    • Recently you updated your system and now you=E2=80=99d lik= e to list all the files max. a week old that are larger than e.g. 30MB each= . Also, you=E2=80=99d like to=C2=A0sum th= e results per each directory and see a total summary.
    1. $ wii -c "-type f -size +30M -mtime= -7"
    • In all of the examples from above, there would be =E2=80=9Ctotal=E2=80= =9D visible at the bottom of each list, where you could=C2=A0check how many of those files share the same filename, which may indicate unwanted duplicates.

    Please let me know what you think.

    Than= ks in advance!

    Cheers,
    Jasmin Zain= ul
    --000000000000803f5305aafb8e07--