LinuxCommandLibrary

mcopy

Copy files to/from MS-DOS filesystems

SYNOPSIS

mcopy [-ntvqsm] source target

PARAMETERS

-n
    No formatting. Don't format the disk if the filesystem isn't found.

-t
    Text mode. Convert end-of-line characters.

-v
    Verbose mode. Display more information during the copy process.

-q
    Quiet mode. Suppress normal output.

-s
    Source directory. Treat the source as a directory even if it isn't.

-m
    Preserve modification time.

source
    The source file(s) or directory(ies) on the Linux filesystem.

target
    The target file or directory on the MS-DOS filesystem. drive::path.

DESCRIPTION

The mcopy command allows copying files between Linux (or other Unix-like) systems and MS-DOS formatted filesystems, often found on floppy disks or USB drives. It handles the differences in file formats and naming conventions between the two operating systems. mcopy transparently converts text files between DOS and Unix formats. It can create new directories on the MS-DOS filesystem if needed.
The command is part of the Mtools package, a collection of utilities for accessing MS-DOS filesystems from Linux. It can be used to transfer data or programs in both directions between machines. mcopy is very useful to create bootable usb disks when other tools are not available. mcopy can be used non interactively, making it easy to write scripts that generate bootable disks and transfer data on them.

CAVEATS

If the target DOS filesystem is not already formatted, you should format it first using mformat or another formatting utility before using mcopy to write files to it.

DRIVE SPECIFICATION

The drive is specified as 'A:', 'B:', etc. If no drive is specified mtools attempts to discover the correct drive and fails if there are too many possibilities.

FILE SPECIFICATION

A directory or a file is specified using normal DOS conventions as in 'A:\MYDIR\MYFILE.TXT'. Note that filename completion can be used. Note also that the backslash must be escaped in some shells like bash. Examples:
mcopy myfile a:\
mcopy myfile a:/
mcopy myfile a:/

HISTORY

mtools has been around since the early days of Linux, providing essential tools for interacting with MS-DOS filesystems. It allowed Linux users to access the data of MS-DOS machines, especially those from floppy disk drives.

SEE ALSO

mdir(1), mformat(1), mtools(1)

Copied to clipboard