4 ms·
Okay, haven't got that so far. Maybe I'm missing some skillset to understand.
by erikb 11y ago
Okay, haven't got that so far. Maybe I'm missing some skillset to understand.
- washadjeffmad 11y agoYou've understood the general use description of mv (copy-rename-delete), but what OP demonstrates is a situation in which it does something unexpected (and inappropriate) when dealing with mounted directories. See the part where he creates file 'bar' in mounted directory /mnt, attempts to move /mnt within itself to /mnt/foo, then asks to show the directories containing /mnt. The result is that the mv fails (so it shouldn't do anything, right?), but still creates an additional directory (/mnt/foo) that now contains 'bar' and has (destructively) altered the fs hierarchy. However, when he tries it again after unmounting /mnt, the behavior is completely normal for any other file-- mv fails, nothing happens, /mnt/bar hierarchy is preserved, no /mnt/foo created.
- erikb 11y agoThanks, now I understand what's going on! Great explanation!