If you for example look at the attribute in Terminal using the xattr
command, you'll find that there it is named "com.apple.lastuseddate#PS" with #PS" meaning that the attribute "sticks" to the file when it is copied or synced. Just copying the file alone won't remove the last used date from it - the timestamp would be copied along with the file contents.
You can delete the attribute from the file like this:
xattr -d com.apple.lastuseddate#PS myfile
However, the attribute is still shown in Finder, and so the file still appears in the Recents folder.
A "somewhat simple" way of getting a file out of the Recents folder is actually to copy it in the Terminal using the cp -X
command, which copies the file without the metadata attributes. You would then remove the old file and rename the copy back to the original name. As an example a file named myfile.wav
could have its last used attribute removed like this:
cp -X myfile.wav myfile.wav.copy
rm myfile.wav
mv myfile.wav.copy myfile.wav
Note: This also removes other attributes on the file - so be careful if there's something there you want to preserve.
If you want to delve even more into the technical details of the "Recents" folder, you should note that the folder in Finder is actually simply a saved Spotlight query. You can review the saved searches used by Finder by opening this folder in Finder (by using the Go menu in Finder and choosing "Go to Folder..."):