English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Linux mcopy command is used to copy MSDOS format files to Linux or copy MSDOS files from Linux to disk.
mcopy can copy a single file to the specified file name or copy multiple files to the specified directory. The source and destination files can be MSDOS or Linux files.
The mcopy command is a mtools tool command that can copy files in the DOS system or copy files between DOS and Linux operating systems.
mcopy [-bnmpQt/][Source file][Target file or directory]
Parameters:
b Batch mode. This is the optimized option for copying a large number of files, but there may be security issues when the program crashes during the file copy process./ Recursive copy. Includes files contained in the directory and all subdirectories below.
-n When overwriting other files, no confirmation is needed and overwrite directly
m Set the modification time of the source file to the modification time of the target file.
p Set the properties of the source file to the properties of the target file.
Q When multiple file copy errors occur, end the program as soon as possible.
t Convert to text file.
o There will be no warning messages when overwriting MSDOS files.
Copy the autoexec.bat in the root directory of drive A to the current working directory:
mcopy a:autoexec.bat .
When copying content that includes subdirectories and files, you must use the parameter"-/"Recursive operation, so this command is:",
mcopy -/ A:\*
Before executing this command, first use the mdir command to view the original directory structure. After executing mcopy, you can use the ls command to view the file structure in the Linux system after copying, as shown below:
cmd@cmd-desktop:~$ mdir -/ a:\* #View files in drive A Volume in drive A has no label #Loading information Volume Serial Number is 13D2~055C Directory for A:/ #The following is directory information #Filename directory size Modification time ./TEST <DIR> 2019-09-23 16:59 AUTORUN.INF 265 2019-09-23 16:53 AUTORUN.BAT 43 2019-09-23 16:56 3 files 308 bytes #Total size 724 325 bytes free #Remaining 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 #Copy the contents of drive A to the Linux file system structure