I was playing around with OSX find
and GNU find
from findutils
(v 4.4.2) package for learning purposes. GNU find has a -delete
option, which is self-explanatory. What isn't, however, is that "Use of -delete automatically turns on the -depth option", which means it will recursively remove the current working directory content without a warning.
The problem is I accidentally executed such a command on my system, instead of remote shell session.
I tried to research the internals behind -delete
but all I could come up with was official GNU findutils docs.
As I realised what happened, I turned off the system to prevent possible overwriting of sectors. Then, I took a "standard recovery approach" using
- EaseUS Data Recovery Wizard for Mac
- Prosoft Data Rescue 3
- Disk Drill
- Mac Data Recovery Guru
but to no results. The removed directory was actually a git repository with many small files. As close-to-zero disk operation was made since the deletion, I doubt all of them could get overwritten. It's not a disastrous situation because I'm obviously pull the repository content from remote. Still, I loose unpublished local branches and files under .gitignore.
Are there any OSX mechanisms I could use to get these files back?