That's a fair point. What we do when a filesystem gets full is email an alert and include the output from:

du --time -ahx /mountpoint | sort -k1,1hr -k4 | expand | head -100

You can quickly see the biggest directories and files, and if you knew one was a file (like a large log file), it might be an immediate target for clearing space.

Example, if the directories had trailing /, it would look like this:

3.7G    2023-10-20 09:31        ./
417M    2023-09-27 11:50        ./logs/
413M    2022-09-24 06:25        ./img/
254M    2023-08-08 09:29        ./monthlies/
247M    2023-10-18 10:08        ./patching/
131M    2023-10-19 09:57        ./awlprobdds01.pcap

In this case, I'd probably move or delete the pcap file. I know that is normally recognized as a file, but sometimes it isn't so clear and why a trailing / for dirs would be nice.

Rusty

----- Original Message ----- From: "Pádraig Brady" <p...@draigbrady.com>
To: "Rusty Duplessis" <ru...@bobpooch.com>; <coreutils@gnu.org>
Sent: Friday, October 20, 2023 6:18 AM
Subject: Re: du enhancement


On 20/10/2023 00:22, Rusty Duplessis wrote:
Would be nice to have an option to append a / to the end of directory names, so that you can distinguish between a file and directory when using -a. Something like -F option to ls.

It's a good suggestion.

I generally only use du with single files / dirs,
or otherwise I use a wrapper that makes dirs obvious (though coloring):
http://www.pixelbeat.org/scripts/dutop

I.e. the default output from du -a is hard to parse.

thanks,
Pádraig


Reply via email to