Is there some order of operations to rm
? I performed rm
on a large directory and am curious where I should look to see what might have been deleted. Does rm
work on files first, then directories? Or is it based on some information in the inode table?
Specs: rm from GNU coreutils 8.22 system: Arch Linux running on a beagleboneblack filesystem operating on was an external Seagate HDD (ext4) using USB 2.0.
Backstory:
I was performing some directory cleanup and performed
cp -r A/ B/ C/ Dest/
Unwittingly, I followed that up with
rm -r A/ B/ C/ Dest/
when I meant to simply perform
rm -r A/ B/ C/
I caught this and hit Ctrl+C before too long had passed. Specifically, it was < 3 seconds as I was using the time
command in conjunction with rm
& cp
. I went in and examined Dest/
expecting it to be non-existent, but lo and behold it was whole and appeared to not be affected. This is a bit surprising as A/
B/
C/
were quite small. Maybe 100–200 MB total. Dest/
however, is just shy of 1TB. Performing an ls
on Dest/ showed that there were both files and directories at both ends of the alphabet (e.g. AFile.txt
.... .... Zoo.txt
).
Did I get lucky and cancelled the rm
before it wrought havoc on my Dest/ directory? Is rm
really that slow (thankfully!)?
If not, how does rm
go about recursively removing things such that I can guess what might have been lost?
I'm not really expecting to recover what I might have lost, just curious what potentially was blown away.