mtools—A collection of tools for manipulating MS-DOS files
The mtools are
mattrib—Change MS-DOS file attribute flags
mbadblocks—Test a floppy disk, and mark the bad blocks in the FAT
mcd—Change MS-DOS directory
mcopy—Copy MS-DOS files to/from UNIX
mdel—Delete an MS-DOS file
mdir—Display an MS-DOS directory
mformat—Add an MS-DOS filesystem to a low-level formatted floppy disk
mlabel—Make an MS-DOS volume label
mmd—Make an MS-DOS subdirectory
mmount—Mount an MS-DOS disk
mrd—Remove an MS-DOS subdirectory
mmove—Move or rename an MS-DOS file or subdirectory
mren—Rename an existing MS-DOS file
mtype—Display contents of an MS-DOS file
mtest—Test and display the configuration
mtools is a public domain collection of programs to allow UNIX systems to read, write, and manipulate files on an MS-DOS filesystem (typically a floppy disk). Where reasonable, each program attempts to emulate the MS-DOS equivalent command.
However, unnecessary restrictions and oddities of DOS are not emulated. For instance, it is possible to move subdirectories from one subdirectory to another.
MS-DOS filenames are optionally composed of a drive letter followed by a colon, a subdirectory, and a filename. Filenames without a drive letter refer to UNIX files. Subdirectory names can use either the / or \ separator. The use of the \ separator or wildcards will require the names to be enclosed in quotes to protect them from the shell. (Note: Wildcards in UNIX filenames should not be enclosed in quotes, because here users want the shell to expand them.)
DIFFERENCES WITH MS-DOS
The regular expression “pattern matching” routines follow the UNIX-style rules. For example, * matches all MS-DOS files in lieu of *.*. The archive, hidden, read-only, and system attribute bits are ignored during pattern matching.
All options use the – (minus) flag, not / as you’d expect in MS-DOS.
Most mtools commands allow multiple filename parameters, which doesn’t follow MS-DOS conventions, but which is more user friendly.
The mcd command is used to establish the device and the current working directory (relative to the MS-DOS filesystem); otherwise, the default is assumed to be A:/. However, unlike MS-DOS, there is only one working directory, and not one per drive.