If you're used to Windows, it's a bit different
Have you ever made two folders on your computer that should really be one? If you handle a lot of different files and documents 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.
![Option key alert with Merge button](https://www.switchingtomac.com/wp-content/uploads/2020/05/merge_pop-up-window.png)
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.
![Keep Both, Stop, or Replace alert](https://www.switchingtomac.com/wp-content/uploads/2020/05/keep-both_pop-up-window.png)
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.
![Terminal in Spotlight Search](https://www.switchingtomac.com/wp-content/uploads/2020/05/spotlight_terminal.png)
- 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.
![Terminal window with command: ditto -V ~/Desktop/"Test Folder" ~/Downloads/"Test Folder"](https://www.switchingtomac.com/wp-content/uploads/2020/05/ditto_terminal_command.png)
- 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, but it can be a lifesaver when you need to troubleshoot issues like your iPhone earpiece not working. 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.