Today I accidentally wiped my own user home directory by carelessly forgetting the
-name option when running the following command:
$ find ~ ".DS_Store" -delete
However, since I am aware that iCloud Drive can simply be accessed from
~/Library, my first concern after realising my mistake was that it could have deleted everything from the cloud too.
Much to my surprise and relief, everything in iCloud seems to be intact, including directories such as Documents. Why didn’t everything get deleted from there too, though? My terminal was configured with full disk access and it even managed to delete my Apple ID authentication file, prompting a re-login while the command was still running. Is it possible that this was deleted before the shared directories and so, once the command got there, my computer didn’t have cloud access anymore?
Whatever happened, I sure am glad it did, but I would like to understand exactly what saved my iCloud.