你有没有在你的电脑上创建过两个真正应该合二为一的文件夹?如果您每天处理大量不同的文件和文档,您可能经常遇到这个问题。
如果您曾在计算机上发现两个名称相同或略有不同的文件,您可以执行以下两项操作来释放 Mac 上的空间(free up space on your Mac)。一种方法是用另一个文件夹替换一个文件夹。如果这不是一个选项,您将需要学习如何在Mac上合并文件。
在您了解如何在 Mac 上移动文件(how to move files on your Mac)之后,学习这些文件处理技巧是一个很好的下一步。继续阅读以了解如何将两个文件夹合并为一个而不丢失任何文件。
如何在 Mac 上替换文件(How To Replace Files On Mac)
如果您知道您的计算机上有两个相同的文件或文件夹并且只想保留一个,您可以通过将其中一个替换为另一个来实现。
- 选择您要保留的文件。
- 单击(Click)文件以选择它。然后将其拖到您要替换的文件的顶部。
- 当你放下它时,你会得到一个弹出窗口,询问你是要替换(Replace)第二个文件还是停止(Stop)。
如果您选择Replace,Finder将删除第二个文件及其所有内容。因此,在您这样做之前,请确保您最近备份了所有文件(have a recent backup of all your files),以免丢失任何重要数据。
或者,您可以选择停止(Stop)并学习如何合并两个文件。这样您就可以保留所有文件,而不会在计算机上造成混乱。
如何合并两个文件夹 (How To Merge Two Folders )
当您不确定两个文件夹是否具有相同的内容时,您可以将它们合并在一起以确保安全。
为了在Mac上合并两个具有相同名称的文件夹,请按照以下步骤操作。
- 选择合并文件夹的最终位置。您需要它来决定要移动两个文件夹中的哪一个。
- 选择要移动的文件夹。
- 按住Option键 ( Alt ),然后将要删除的文件夹拖向要与其合并的文件夹。
- 仍然按住Option键,放下文件夹。
- 您将看到一个弹出窗口,现在可以选择合并(Merge)文件。
请注意,只有当其中一个文件夹的内容与另一个文件夹的内容不同时,才会出现合并选项。( Merge)如果您的两个文件夹中包含相同的项目,您将只能获得相同的停止(Stop)和替换(Replace)选项。
如何在Mac上合并两个不同名称的文件夹(How To Merge Two Folders On Mac With Different Names)
如果您要加入的两个文件夹名称不同,您只需更改一个文件夹的名称以匹配另一个文件夹,然后使用上述方法将它们合并。
另一种方法是手动将其中一个文件夹的内容移动到另一个文件夹。
- 打开要删除的文件夹。
- 从顶部的功能区菜单中,选择“编辑(Edit)” > “全选”(Select All )以选择文件夹内的所有文件。您也可以使用键盘快捷键Cmd ( Command ) + A来完成。
- 将文件拖放(Drag)到第二个文件夹中。
- 移动文件后,删除空文件夹。
如果您要合并的两个文件夹具有相同名称的文件,您将收到一个弹出窗口,询问您是否要同时保留(Keep Both)、停止(Stop)或替换(Replace)文件。选择同时保留将保存具有相同名称的文件副本,并在末尾添加单词“副本”。
使用同上终端命令(Use The Ditto Terminal Command)
对于高级用户,还有另一种在Mac上合并文件的方法。您可以使用名为Ditto的(Ditto)终端(Terminal)命令。
- 打开Spotlight并在搜索栏中 输入终端。(Terminal)
- 在终端(Terminal)中,输入同上(Ditto)命令。
该命令使用以下语法:
ditto / source / destination
我们在桌面上有一个名为Test Folder的文件夹,以及一个存储在(Test Folder)Downloads中的同名文件夹。这两个文件夹的同上命令如下所示:
ditto -V ~/Desktop/”Test Folder” ~/Downloads/”Test Folder”
如果文件名只有一个单词(如“Test”),则无需在命令中使用双引号。
- 按Enter 键(Enter),该命令将用源文件夹的内容覆盖目标文件夹的内容。
掌握同上(Ditto)命令可能看起来有点棘手,尤其是如果您以前从未使用过终端(Terminal)。但是,这是在Mac(Mac)上合并两个文件夹的更复杂和有效的方法。
学会智能地使用你的 Mac(Learn To Use Your Mac Intelligently)
(File)如果您不知道系统是如何工作的, Mac上的(Mac)文件处理可能会有些混乱。但是,如果您不想遇到空间不足或在一堆数字混乱中难以找到正确文件等问题,那么学习操作文件是必不可少的。
一旦您掌握了在 Mac 上替换和合并文件等命令,看看如何在(how to permanently delete)Mac上永久删除和密码保护您的文件(password protect your files on Mac)。
您是否因使用相同文件而过度填充计算机而受苦?你通常如何解决这个问题?在下面的评论中与我们分享(Share)您的想法。
How to Replace and Merge Files on Mac
Have you ever made two folders on your computer that should really be one? If you handle a lot of different files and doсuments on a daily basis, you’ve probably come across that issue often.
If you’ve ever found two files on your computer with the same or slightly different names, there are two things you can do to free up space on your Mac. One way to do it is to replace one folder with the other. When that’s not an option, you’ll need to learn how to merge files on your Mac.
Learning these file handling tricks is a good next step after you learn how to move files on your Mac. Read on to find out how to join two folders into one without losing any of your files.
How To Replace Files On Mac
If you know that you have two identical files or folders on your computer and want to only keep one, you can do it by replacing one of them with the other.
- Choose the file you’d like to keep.
- Click on the file to select it. Then drag it on top of the file you’d like to replace.
- When you drop it, you’ll get the pop-up window asking whether you want to Replace the second file or Stop.
If you choose Replace, Finder will delete the second file with all its contents. So before you do that, make sure you have a recent backup of all your files so you don’t lose any important data.
Alternatively, you can select Stop and learn how to merge two files instead. That way you can keep all of your files without building up clutter on your computer.
How To Merge Two Folders
When you’re not sure whether two folders have the same contents, you can play it safe by merging them together.
In order to merge two folders with identical names on Mac, follow these steps.
- Choose the final location of the merged folder. You need that to decide which of the two folders you will be moving.
- Select the folder that you want to move.
- Hold down the Option key (Alt), then drag the folder you’d like to get rid of towards the folder you want to merge it with.
- Still holding the Option key, drop the folder.
- You’ll get the pop-up window that will now have an option to Merge the files.
Note, that the Merge option will only appear if the contents of one of the folders differ from the contents of the other folder. If both of your folders have the same items in them, you will only get the same Stop and Replace options.
How To Merge Two Folders On Mac With Different Names
If the two folders you’d like to join have different names, you can simply change one folder’s name to match the other and use the method described above to merge them.
Another way to do it is to manually move the contents of one of the folders to the other.
- Open the folder that you want to get rid of.
- From the ribbon menu on top, choose Edit > Select All to select all the files inside the folder. You can also do it by using the keyboard shortcut Cmd (Command) + A.
- Drag and drop the files into the second folder.
- After you move the files, delete the empty folder.
If the two folders you want to merge have the files with the same names, you’ll get a pop-up window asking if you want to Keep Both, Stop, or Replace the file. Choosing to Keep Both will save the copy of the file with the same name and the word “copy” added at the end.
Use The Ditto Terminal Command
For advanced users, there’s one more way to merge files on a Mac. You can use the Terminal command called Ditto.
- Open Spotlight and type Terminal into the search bar.
- In Terminal, type in the Ditto command.
The command uses the following syntax:
ditto / source / destination
We have a folder with the name Test Folder located on the desktop, and a folder with the same name stored in Downloads. Here’s what the ditto command for those two folders looks like this:
ditto -V ~/Desktop/”Test Folder” ~/Downloads/”Test Folder”
If the name of your file only has one word (like “Test”), you won’t need to use double quotes in the command.
- Press Enter and the command will overwrite the contents of the destination folder with those of the source folder.
Mastering the Ditto command might seem a little tricky, especially if you’ve never used Terminal before. However, it’s a more sophisticated and effective way of merging two folders on a Mac.
Learn To Use Your Mac Intelligently
File handling on Mac can be a little confusing if you don’t know how the system works. However, learning to operate your files is essential if you don’t want to run into problems like not having enough space, or struggling to find the right file in a pile of digital clutter.
Once you master commands like replacing and merging files on Mac, have a look at how to permanently delete and password protect your files on Mac.
Do you suffer from overpopulating your computer with identical files? How do you normally solve that problem? Share your thoughts with us in the comments below.