Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the use of Linux's mcopy command

Shulou Source: shulou.com Published: 2022-06-01 14:06:21 10月05日 Update

Today, I would like to share with you the relevant knowledge about the use of Linux's mcopy command. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.

The Linux mcopy command is used to copy MSDOS format files to Linux, or from Linux to copy MSDOS files to disk. Mcopy can copy a single file to a specified file name, or several files to a specified directory. The source and destination files can be MSDOS or Linux files. The mcopy instruction is a mtools tool instruction that can copy files on a DOS system or between DOS and Linux operating systems.

Syntax mcopy [- bnmpQt/] [source file] [target file or directory]

Parameters:

B batch mode. This is the option to optimize for a large number of file copies, but security issues arise when crash is generated in the process of copying files. / recursive copy. Contains the files contained in the directory and the files in all subdirectories below it. When overwriting other files, m sets the modification time of the source file to the modification time of the target file without confirmation. P sets the properties of the source file to the properties of the target file. Q when copying multiple files causes an error, end the program as soon as possible. T is converted to a text file. O No warning message appears when overwriting MSDOS files. Example

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

Mcopy a:autoexec.bat.

When the copied content includes subdirectories and files, you must use the parameter "- /" recursive operation, so the command is:

Mcopy-/ A:\ *

Use the mdir command to view the original directory structure before executing the command, and then use the ls command to view the file structure in the replicated Linux system after executing mcopy. The results are as follows:

Cmd@cmd-desktop:~$ mdir-/ a:\ * # View the files in disk A Volume in drive A has no label # load information Volume Serial Number is 13D2~055C Directory for avanes / # the following is the directory information # File name directory size modification time. / TEST 2009-09-23 16:59 AUTORUN.INF 2009-09-23 16:53 AUTORUN.BAT 43 2009-09-23 16:56 3 files 308 bytes # Total size 724325 Bytes free # remaining space cmd@cmd-desktop:~$ mcopy-/ A:\ * # copy all the files on disk A to the current working directory cmd@cmd-desktop:~$ls TEST AUTORUN.INF AUTORUN.BAT # An and copy them to the Linux file system structure. These are all the contents of the article "what are Linux's mcopy commands for?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Tags: File directory command content knowledge article system time source file target structure information parameter size subdirectory attribute instruction work different Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Huawei Redmi Xiaomi Shulou Tech Info