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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. How to Partition DM-Multipath Pseudo Devices in CentOS/RHEL
  2. What are sparse files in Linux
  3. CentOS / RHEL : How To Shrink LVM Root File System
  4. CIFS Share Filesystem Is Not Mounted after Reboot on CentOS/RHEL 7
  5. Active FTP vs. Passive FTP
  6. imagemagick for image optimization
  7. Using vmstat to troubleshoot performance issues in Linux
  8. /var/cache/yum Constantly Filling Files System in CentOS/RHEL
  9. The Ultimate Beginner’s Guide to Static Website Hosting With Google Firebase (for FREE)
  10. What’s different between /bin/false and /sbin/nologin as nologin user’s shell

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright