0

This question already has an answer here:

If rm dir -r has removed just partial content of dir/dir1/ (and I cancelled rm), has it not removed anything in dir/dir2/ if dir/dir2/ still exists and contains something? My OS is Ubuntu 14.04 and filesystem ext4.

I heard How does rm -r go about recursively removing? In what order?, but can my question be answered more surely?

My OS is 64bit Ubuntu 14.04 with ext4 filesystem.

Knowing if rm completely remove a subdir before removing another subdir is weaker than knowing the order of rm operating in. So my question is not duplicate of the linked one.

marked as duplicate by msw, Michael Homer, mdpc, jasonwryan, chaos Mar 25 '15 at 6:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

The top-voted answer (https://unix.stackexchange.com/a/161772/88983) in the question you linked to says the following:

The order of traversal is unpredictable. (...) The order of traversal isn't something you can rely on.

So I would say you generally cannot know for sure whether rm deleted items in dir/dir2. What you could do, however, is run rm in verbose mode on a copy of your directory and see if, on your system, there seems to be some order of traversal.

  • Thanks. but knowing if rm completely remove a subdir before removing another subdir is weaker than knowing the order of rm operating in. – Tim Mar 25 '15 at 2:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.