One of the things I like doing with du is going through directories
when I have run out of disk space, trying to find out what is taking up
of the room. I use max-depth to try and filter the directories, but this
tends to have the problem that I either end up with a few, big
directories, which I then need to run du on again, or many small
directories which are hard to read. Wouldn't it be great if you could do
du --min-size=3G and find all directories bigger than 3G?
only if it is N or fewer levels below the
command\n\
line argument; --max-depth=0 is the same as\n\
--summarize\n\
+ --min-size=SIZE allows a minimum cumulative size a
directory/file must\n\
+ be before it is displayed\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
@@ -465,8 +474,11 @@
if (!print)
return ok;
- if ((IS_DIR_TYPE (ent->fts_info) && level <= max_depth)
+ if (
+ ((IS_DIR_TYPE (ent->fts_info) && level <= max_depth)
|| ((opt_all && level <= max_depth) || level == 0))
+ && (size_to_print>min_size)
+ )
{
print_only_size (size_to_print);
fputc ('\t', stdout);
@@ -627,6 +639,10 @@
}
break;
+ case MIN_SIZE_OPTION: /* --min-size=SIZE */
+ human_output_opts = human_options (optarg, true, &min_size);
+ break;
+
case 'm': /* obsolescent: FIXME: remove in 2005. */
human_output_opts = 0;
output_block_size = 1024 * 1024;
Thanks,
David
P.S. even if you don't like the patch, I think the idea is a good one.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.