Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Linux mcopy Command

Linux mcopy Command

Linux Command Reference Linux Command Reference

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

mcopy can copy a single file to a specified filename, or copy several files into a specified directory. Source and destination files can be either MSDOS or Linux files.

The mcopy command is an mtools utility command that can copy files within DOS or between DOS and Linux operating systems.

Syntax



mcopy [-bnmpQt/][源文件][目标文件或目录]

Parameters:

Example

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

mcopy a:autoexec.bat .

When the content to be copied includes subdirectories and files, you must use the "-/" parameter for recursion, so the command is:



mcopy -/ A:\* 

Before running this command, use the mdir command to view the original directory structure; after running mcopy, you can use the ls command to view the file structure in Linux after the copy. The result is as follows:



cmd@cmd-desktop:~$ mdir -/ a:\* #查看A 盘中的文件  

Volume in drive A has no label #加载信息  

Volume Serial Number is 13D2~055C  

Directory for A:/ #以下为目录信息  

#File name directory size modification time

./TEST  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 #统计总大小  

724 325 bytes free #剩余空间  

cmd@cmd-desktop:~$ mcopy -/ A:\* #将A盘上的所有文件复制到当前工作目录  

cmd@cmd-desktop:~$ls  

TEST AUTORUN.INF AUTORUN.BAT #A盘中的内容复制到Linux文件系统结构中 

Linux Command Reference Linux Command Reference