What's the order of deletion when I do "rm -rf data"?
I accidentally did it rm -rf data
in a huge directory. I left immediately.
The directory has a simple structure (all date subcategories like 2015/07/06) but the directory is huge and I don't want to regenerate the whole thing. If I knew how I rm
deleted the files, I could only find and restore the missing ones.
How rm -rf
about deleting files?
source to share
rm
performs a depth-first search , following the call results xfts_open
.
FTS is the standard by which files are moved across all Linux tools. You can write your own fts consumer, or trust the output from find
, as it uses as well xfts_open
.
find .
the files that exist will be listed. You can then use your knowledge of the expected structure to reverse the list that is missing.
Alternatively, you can use debugfs
to help you get the files.
source to share