Physics Computer Group • Help & Support
Austin, TX  •  16:33 (CDT)  •  13°C/55°F
Get help with…
Printing
E-mail
Software
Accounts
Everything else
How to Contact Us
help@physics.utexas.edu
(512) 471-5821 • RLM 7.126
Frequently Asked Questions
How do I burn files to a CD?
Do the machines support USB sticks?
Can I use Windows disks from Linux?
I need someone’s email address….
Links to Other Useful Sites
Physics webmail portal
PMCL (student computer lab)
BevoWare (free antivirus & utilities)
Accessing DOS/Windows Disks

Accessing DOS/Windows (FAT-formatted) disks, such as floppy disks or USB sticks, can be accomplished on the GNU/Linux systems via the mtools(3) tool suite. These tools emulate all of the common DOS command-line file commands (DIR, COPY, DEL, etc.) — although, in many cases, there are slight changes that you need to be aware of.

In general, you can use a DOS command by prefixing it with ‘m’ — for example, dir becomes mdir. Drives are addressed in DOS parlance: The floppy drive is considered “A:” — but the UNIX directory separator (‘/’) is used, so the DOS file A:\somefile.txt becomes A:/somefile.txt. Likewise, since ‘/’ is used as a directory separator, DOS commands that would normally take command-line options use ‘-’ (hyphen) instead of ‘/’ as the option flag.

The following MTOOLS commands are summarized here; see the man page on the system for a given command for more details. The complete list of MTOOLS commands is available from the mtools(3) man page.

mcd [dosdirectory]

Changes the current directory within the DOS file system. If no directory is specified, then the current DOS directory is printed to the console.

mcopy [options] source_file [another_source_file …] [target_file_or_directory]

Copies the specified file to the specified new filename/location, or to the current directory if no destination is specified. The most common options are -t (convert a text file between UNIX and DOS formats, as appropriate), -m (preserve modification time), and -v (display the name of each file as it is copied, useful for batch transfers). See the mcopy man page for the full list of available options.

mdel [-v] file [another_file …]

Deletes DOS files. If a read-only file is specified, mdel will ask for confirmation before deleting it. If the -v flag is specified, then the name of each file will be displayed as it is deleted. There is also an mdeltree command that is used to delete an entire directory at once (similar to the standard UNIX rm -r).

mdir [options] dos_dir_or_file [another file …]

Displays the contents of DOS directories, or the entries for specific files. Supports the following options:

     -/ — Recursive output

     -a — List all files, including those marked as “hidden”

     -w — “Wide” optput, including file modification dates and sizes

     -b — “Brief” listing (minimal details)

     -f — “Fast” listing, omitting the free-space calculation (which is a non-trivial operation in some cases)

mtype [-ts] file [another_file …]

Prints the contents of the specified file(s) to the console. The -t flag converts all incoming DOS end-of-line sequences (CR-LF) into UNIX end-of-line sequences (LF). The -s flag strips the high bit from each incoming octet before printing. Note that, unlike the DOS type command, mtype accepts multiple filename arguments (like UNIX’s cat).