Easy Tutorial
❮ Linux Comm Groupmod Linux Comm Adduser ❯

Linux mcopy Command

Linux Command Handbook

The Linux mcopy command is used to copy MSDOS format files to Linux or to copy MSDOS files from Linux to a disk.

mcopy can copy a single file to a specified filename or multiple files to a specified directory. Both source and destination files can be MSDOS or Linux files.

The mcopy command is a mtools tool command that can copy files in a DOS system or between DOS and Linux operating systems.

Syntax

mcopy [-bnmpQt/][source file][destination file or directory]

Parameters:

Example

Copy autoexec.bat from the root directory of drive A to the current working directory:

mcopy a:autoexec.bat .

When copying includes subdirectories and files, the "-/" parameter must be used for recursive operation, so the command is:

mcopy -/ A:\*

Before executing this command, use the mdir command to view the original directory structure. After executing mcopy, use the ls command to view the file structure in the Linux system, as follows:

cmd@cmd-desktop:~$ mdir -/ a:\* # View files in drive A
Volume in drive A has no label # Mount information
Volume Serial Number is 13D2~055C
Directory for A:/ # Directory information
# Filename directory size modification time
./TEST <DIR> 2009-09-23 16:59
AUTORUN.INF 265 2009-09-23 16:53
AUTORUN.BAT 43 2009-09-23 16:56
3 files 308 bytes # Total size
724 325 bytes free # Free space
cmd@cmd-desktop:~$ mcopy -/ A:\* # Copy all files from drive A to the current working directory
cmd@cmd-desktop:~$ ls
TEST AUTORUN.INF AUTORUN.BAT # Contents of drive A copied to the Linux file system structure

Linux Command Handbook

❮ Linux Comm Groupmod Linux Comm Adduser ❯