File System Update Delay

I regularly move/copy/remove files from the terminal using mv/cp/rm shell commands. With Catalina (10.15.5), file system updates are not reflected in the Finder windows until several minutes later. That is, I can rm a file and it will still show up in the corresponding Finder window for at least several minutes.

How should I go about diagnosing this behavior? Could any of the following be contributing to it, and if so, how?

  • If the folder is on an SSD formatted with HFS+ rather than AFPS
  • Whether the folder is on a disk image and/or one with encryption
  • Whether there are 1000+ files in the folder
  • File sizes and/or types

One thing that does work is running disk first aid from Disk Utility or diskutil verifyVolume after any of these commands.


Solution 1:

Just to set a base line, I can say that my Catalina installation does not exhibit any such delay for updating Finder windows. Doing mv/copy/remove operations from the Terminal updates the Finder windows immediately.

This is on Catalina 10.15.5 on an encrypted APFS SSD, and works with any file size and file type (as far as I can tell).

Solution 2:

What I'd do as a first check would be to run ls -lrt directly after you remove a file and verify that way that the file is indeed gone. Or use this after moving a file and seeing how they do that way. Removing a file with rm should be an immediate action. Checking if it has indeed been removed should show up in the ls -lrt command. or if you do have a lot of files try

ls -lrt | grep filename

and the file should be gone.

This will tell you if the delay is real