macOS Filesystem – Deleting Multiple Copies of Files

filesystemmacossd card

I have maintained backups of 'All My Files' on an external secure shell card and have overwritten the originals several times. Now there are multiple copies of several files wherein they are labeled 'example_1', 'example_2', 'example_3' and so on.

Is there any way to differentiate between these copies and the originals so that I can delete the extras and free the space they're taking up without damaging my computer's functionality?

I'm fairly certain some of the copied files are possibly data files and other necessary items.

Here is a screenshot of what I am describing:

Multiple copies of files on my SD card.

Best Answer

Firstly, a better way to make backups would be to use Time Machine. This will maintain a backup that can be restored, as it was backed up.

Simply copying files to another disk is a fine backup method, but copying files from All My Files will copy them "out of context". All My Files is a sort of "smart folder" that dynamically displays documents from your Mac or iCloud Drive. This view can be useful for your viewing & access. But this view of those files does not show any folder hierarchy for where those files are actually stored.

I notice that one such file that you've copied is __init__.py, which is a special file for the Python language. I'm guessing it originally was located in a folder for, perhaps, a cloned GitHub repository? Copying this file to a "backup" is fine, but for it to be useful, it needs to be kept with the other files/folders it was with.

One of the most important elements of making backups is that the backed up data can later be restored in a usable state, as it was originally arranged. This is why I'm recommending making backups with a tool, such as Time Machine. Or, if you'd rather backing up a smaller set of things from your computer, for limited space available on your backup media, you should not make those backups from a dynamic view such as All My Files. But instead, make backups of the literal folders of things you'd like not to loose.


Now, as far as all those duplicates, in certain situations of copying files, Mac OS will increment a number "at the end of the filename". So, for the example of __init__.py, the duplicates all are named __init__NN.py. (The files with additional/incremented numbers at the end, before any last .name are extra copies.)