Something is renaming my files and folders

My Mac is renaming my files and folders with no interaction from me. I'm using terminal for most of my work, so this description uses terminal commands. For example, A program I wrote creates a folder 'FL_REV5' with hundreds of folders and files within. My program exits, then I type ls and see the folder. A few seconds later I type ls again, and it is now "FL_REV5 2". I type mv 'FL_REV5 2' FL_REV5. Another ls shows it renamed, and a few seconds later I have 'FL_REV5 2' again. A restart didn't help.


This happens to files too. I can't predict when it will happen or not happen. I think it started after the Sequoia 15.3.1 update, but I'm on 15.3.2 now. I'm seeing the problem mostly with files and folders produced by a python program, but I have also seen it happen to files produced by regular apps too. It happens when I rename the folder using Finder too: I can watch the name change back 2 seconds later.


A workaround is to copy the misnamed folder to ~/Downloads. A rename there sticks. Other than being a copy, the only difference I can think of is that my Downloads folder is not backed up by TimeMachine and is not synced with iCloud (my #1 suspicion).


What might be running on my Mac that renames existing files?

MacBook Air 13″

Posted on Apr 2, 2025 11:11 AM

Reply
8 replies
Sort By: 

Apr 3, 2025 7:47 AM in response to Mike LaBonte

Mike LaBonte wrote:

My Mac is renaming my files and folders with no interaction from me. I'm using terminal for most of my work, so this description uses terminal commands.

For example, A program I wrote creates a folder 'FL_REV5' with hundreds of folders and files within. My program exits, then I type ls and see the folder. A few seconds later I type ls again, and it is now "FL_REV5 2".

I type mv 'FL_REV5 2' FL_REV5. Another ls shows it renamed, and a few seconds later I have 'FL_REV5 2' again. A restart didn't help.

This happens to files too. I can't predict when it will happen or not happen. I think it started after the Sequoia 15.3.1 update, but I'm on 15.3.2 now. I'm seeing the problem mostly with files and folders produced by a python program, but I have also seen it happen to files produced by regular apps too. It happens when I rename the folder using Finder too: I can watch the name change back 2 seconds later.

A workaround is to copy the misnamed folder to ~/Downloads. A rename there sticks. Other than being a copy, the only difference I can think of is that my Downloads folder is not backed up by TimeMachine and is not synced with iCloud (my #1 suspicion).

What might be running on my Mac that renames existing files?



Verify your software is up to date…

The current stable release of Sequoia including bug fixes, security updates is macOS 15.4 — I would start there

Keep your Mac up to date - Apple Support

Keep your Mac up to date - Apple Support


Reply

Apr 3, 2025 9:07 AM in response to Mike LaBonte

Seems like the Finder or macOS is copying the folder for some reason since the " 2" is one of the ways macOS allows a copy to be made to the same enclosing folder. Since there is only one folder there, this is not the entire story. I wonder if you have some folder action or automated script acting on the parent folder for all sub folders.

Reply

Apr 5, 2025 7:43 AM in response to HWTech

Good suggestion, thanks. I checked AppleScript and Automator, nothing there. I'm having the problem also with files that I rsync from another Mac, it looks like existing files are being moved aside. Rsync doesn't do that without --backup, and it doesn't use that naming pattern.


If I see another case where I rename a file and the name springs back, I'll try following the rename immediately with lsof to see if I can catch the process doing it.

Reply

Apr 5, 2025 7:49 AM in response to Gandolf243

I do like MalwareBytes. That said, I used to have it on this Mac, but gave up when I couldn't stop it from using 100% CPU without a break, for days. The thing is, I run programs that generate 20,000+ files, several times a day. All of the processes that inspect files, fileproviderd, WebThumbnailExtension, mds_stores, backupd, etc. seem to burn CPU for hours after each run, MalwareBytes even longer.

Reply

Apr 6, 2025 7:21 AM in response to Luis Sequeira1

Folder Actions is another good suggestions, thanks. I found it disabled. But I think I'm homing in on the problem. I disconnected my Mac from iCloud Drive sync, and so far it hasn't happened again.


I have theories about what is happening, but they all get shot down by the fact that I can see the "file 2.csv" in Finder, rename it to "file.csv", and watch it get renamed back a second or two later. It's hard to imagine why any software feature would do that. For example, maybe TimeMachine keeps files from being changed while it backs them up. But no, that is what snapshots are for.

Reply

Something is renaming my files and folders

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.