by Devin Yang
(This article was automatically translated.)

Published - 1 year ago ( Updated - 1 year ago )

The ditto command first appeared on Mac OS X (10.0)
In some cases, it is more intuitive than the cp command,
Those who are interested can study and test by themselves.

Assuming that there is an envs folder in my directory, my test is as follows:
1. If the target directory does not exist, it will copy and assist in creating the directory.

ditto php_imap ~/phpenv/etc/php_imap

Actual operation screen:

 

Second, if the target resource already has the same folder, it will merge the files into the folder. When the same file name appears, it will overwrite the file

ditto php_imap ~/phpenv/etc/php


Use git diff to view, the original same file It has been changed

3. For example There are a lot of new yaml files in my directory, when I want to move to another area

ditto *.yml ~/phpenv

Tags: macos

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


linux,macos

PS aux will you?

For Linux system administrators, you must understand the ps aux command. If you want to be a Linux system administrator, or you are a Linux user, you should understand this command. ps is process status For short, anyone can find out what kind of program is running on the system and how the status is executed through this command. I saw some programs that should not appear, maybe the system was hacked and used to mine🥹

vpn,cli,macos

How do I dial a VPN from the command line on MacOS

I myself will need to use MacOS to dial VPN in the command line. Here I provide my alias and setting method

macos

Say command voice list on macOS

How to speak Mandarin or Cantonese on the terminal on macOS? Click to see