LinuxCommandLibrary

mdu

Display multiple disk usage summaries

SYNOPSIS

mdu [OPTIONS] [msdos_path ...]

PARAMETERS

-a
    Display usage of all files, not just subdirectories.

-s
    Don't print an error message if the directory is empty.

-u
    Display a grand total only for each directory (Unix-style summary).

-v
    Display detailed information about each file and directory (verbose).

-L
    Same as -v, but also displays information about sectors (long format).

-p
    Print progress messages when searching large directories.

-h
    Print sizes in human readable format (e.g., 1K, 234M, 2G).

-t
    Prints one entry per line, suitable for tabulation.

-c
    Prints sizes in cluster units.

-b
    Prints sizes in bytes (this is the default).

-d
    Prints only directories.

-D
    Displays empty directories.

-H
    Displays hidden files (those with the hidden attribute set).

-U
    Displays system files (those with the system attribute set).

-R
    Recursively display directories (this is the default).

-V
    Displays the volume label.

-P
    Display all files and directories, including hidden and system files (same as -H -U).

-f
    Fast mode; skip FAT checks.

-o file
    Specifies an output file for the log.

msdos_path
    The path to the MS-DOS directory. If no path is specified, the current working directory is used.

DESCRIPTION

mdu is a utility included with the
mtools package, which provides a set of tools for accessing MS-DOS filesystems from a Unix-like environment, such as Linux. Unlike the standard du command which works with native Linux filesystems, mdu is specifically designed to analyze disk usage on MS-DOS formatted disks or disk images. It functions much like the Unix du command, allowing users to display the directory tree structure and calculate the disk space consumed by files and subdirectories within an MS-DOS filesystem.

This command is particularly useful when you need to inspect the contents and space allocation of legacy MS-DOS floppy disks, partitions, or disk images mounted via mtools. It can show sizes in bytes, human-readable format, or cluster units, providing various levels of detail from a concise summary to a verbose listing of all files and their attributes. Its primary use case revolves around managing and understanding data on MS-DOS media within a Linux environment, rather than general Linux filesystem analysis.

CAVEATS

The mdu command is not a general-purpose disk usage tool for native Linux filesystems. It is specifically designed for and only works with MS-DOS formatted disks or disk images. It requires the mtools package to be installed on your system, which might not be present by default on all Linux distributions.

USAGE CONTEXT

The mdu command is primarily relevant for users who need to interact with or analyze data on MS-DOS formatted media, such as old floppy disks, USB drives formatted with FAT, or disk images containing MS-DOS filesystems. It is not suitable for analyzing disk usage on modern Linux filesystems like Ext4, XFS, or Btrfs; for those, the standard du command is used.

HISTORY

The mdu command is an integral part of the mtools software suite. mtools is a collection of utilities developed to enable Unix-like operating systems to access and manipulate MS-DOS formatted disks and files without needing to mount them. Its development dates back to the early days of Linux and other Unix-like systems, when MS-DOS compatibility was crucial for data exchange. While the prevalence of MS-DOS media has significantly declined, mtools and thus mdu continue to be maintained for legacy system support and niche applications, primarily by its original author, Alain Knaff.

SEE ALSO

mtools(1), mdir(1), mcopy(1), du(1)

Copied to clipboard