mdel
Delete files on an MS-DOS filesystem
SYNOPSIS
mdel [options] msdos_file [msdos_file...]
PARAMETERS
-v
Enable verbose output, showing each file as it is deleted.
-a
Delete all files matching the pattern without prompting for confirmation for each file.
-s
Suppress the display of filenames as they are deleted (quiet mode). This is similar to -a but without any output.
-D
Experimental: Delete directories as well. Use with caution as this feature might not be fully robust.
--version
Display version information for the mtools package.
--help
Display a help message with available options.
msdos_file
The path to the MS-DOS file(s) to be deleted. Wildcards (* and ?) are supported and follow MS-DOS conventions.
DESCRIPTION
mdel is a utility from the mtools package, designed to delete files from an MS-DOS filesystem. It provides a Linux interface for managing files on media formatted for MS-DOS, such as floppy disks or disk images.
Unlike the standard Linux rm command, mdel understands and operates directly on the MS-DOS filesystem structure, including its filename conventions (8.3 format), attributes (read-only, hidden, system), and distinctions between short and long filenames. It can handle wildcard patterns and offers options for verbose output and confirmation.
It's particularly useful when directly interacting with physical MS-DOS formatted media or disk images without the need to mount them first, providing a convenient way to manage files in cross-platform or legacy environments.
CAVEATS
mdel operates exclusively on MS-DOS filesystems; it will not work on native Linux filesystems. Wildcard matching follows MS-DOS rules, which may differ from typical Unix shell globbing rules. Deleted files are permanently removed and are not moved to a 'trash can' or 'recycle bin', making recovery difficult or impossible using standard tools. The -D option for deleting directories is experimental and should be used with care.
MS-DOS WILDCARDS
mdel interprets wildcards (* and ?) according to MS-DOS rules. The asterisk (*) matches any sequence of characters, and the question mark (?) matches any single character. Unlike some Unix shell interpretations, `*` can match zero or more characters, and the dot (`.`) in filenames is treated as a regular character within wildcard patterns. For example, `*.TXT` matches `FILE.TXT` but also `ANOTHER.TXT` or even `MYFILE` if it had no extension.
CONFIGURATION
The behavior of mdel, like other mtools commands, can be influenced by configuration files, typically `/etc/mtools.conf` and `~/.mtoolsrc`. These files define default drive letters, device paths for floppy drives, and other specific options that affect how mtools interacts with MS-DOS media.
HISTORY
The mdel command is part of the mtools suite, a collection of utilities developed to provide Unix-like access to MS-DOS filesystems without needing to mount them. This was particularly crucial in earlier computing environments where MS-DOS floppy disks were a common means of data exchange between Unix and MS-DOS systems. mtools, and by extension mdel, have been continuously maintained to support evolving MS-DOS/Windows filesystem features, adapting their relevance even as floppy disk usage declined, finding new applications with disk images and embedded systems.