0

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.

Tim
  • 101,790

1 Answers1

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.

dhag
  • 15,736
  • 4
  • 55
  • 65
  • 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 02:00