Forrest logo
back to the robocopy tool

robocopy:tldr:55772

robocopy: Mirror/Sync a directory, deleting anything not in source and include all attributes and permissions.
$ robocopy ${path\to\source_directory} ${path\to\destination_directory} /MIR /COPYALL
try on your machine

The command you provided is using the robocopy utility to copy files and directories from a source directory to a destination directory. Here's a breakdown of the command and its options:

  1. robocopy: This is the command itself, used to initiate the file copy operation.

  2. ${path\to\source_directory}: This is the placeholder for the path to the source directory. You need to replace it with the actual path, specifying the directory from which the files need to be copied.

  3. ${path\to\destination_directory}: Similarly, this is the placeholder for the path to the destination directory. Replace it with the actual path, specifying where the files should be copied.

  4. /MIR: This option instructs robocopy to mirror the source directory to the destination directory. It will copy all files and subdirectories while deleting any files in the destination that do not exist in the source.

  5. /COPYALL: This option specifies that all file information, including timestamps, security attributes, and ownership, should be preserved during the copy process. It essentially duplicates the files with all their properties intact.

By running this command, robocopy will carry out the file copy operation from the specified source directory to the destination directory, ensuring that both directories are in sync.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the robocopy tool