• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

mcopy Command in Linux

by admin

The mcopy command can be used to copy files between Unix and MS-DOS format partitions. The mtools package provides the mcopy command. The mtools package can help you when working with the DOS or Windows operating system while running Linux, and facilitate the transfer of information and manipulation of removable media for those operating systems.

Syntax:

# mcopy [options] sourcefile target

mcopy Command Options

Options Description
-t Convert Unix line breaks to MS-DOS line breaks and vice versa when copying text files.
-b Operate in batch mode; use for large copies of data.
-s Copy recursively.
-P Preserve attributes of copied files.
-Q If one copy fails, stop copying the rest. Useful if you think you may run out of disk space.
-a Assume that all incoming files are ASCII and convert carriage return/line feed to plain line feed.
-T Convert line breaks as with -a, but also convert PC-8 characters to ISO-8859-1 characters. Replace untranslatable characters with # or . for Unix and DOS respectively.
-n Do not ask for confirmation when overwriting Unix files. Use -o to turn off confirmation for overwriting DOS files.
-m Preserve file modification time.
-v Display the names of files as they are copied.
-D clash-option Specify the action to take if the specified directory name already exists. See mmd for the possible clash options.

mcopy Command Examples

1. To copy a file from a floppy disk to the current directory, run this command:

mcopy a:file .

2. Copying files from the local system to the disk is similar:

mcopy file a:

3. Copy autoexec.bat in the root directory of Disk A to the current working directory:

# mcopy a:autoexec.bat

4. When the copied content includes subdirectories and files, the parameter “-/” must be used for recursive operation:

# mcopy -/ A:\* 

Filed Under: Linux

Some more articles you might also be interested in …

  1. mkinitcpio Command Examples in Linux
  2. How to Start, Stop and Restart Zimbra Service
  3. Linux OS Service ‘setroubleshoot’
  4. How To Create An Almost Root Equivalent Users But Not Root Identical User in Linux
  5. How to Find and Delete Empty Directories and Files in Linux
  6. pacdiff Command Examples in Linux
  7. How to disable write access to USB devices using “hdparm” tool
  8. dnsmap Command Examples in Linux
  9. netselect: command not found
  10. pactree: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright