Executing 'mv A B': Will the 'inode' be changed? Executing 'mv A B': Will the 'inode' be changed? unix unix

Executing 'mv A B': Will the 'inode' be changed?


It depends at least partially on what A and B are. If you're moving between file systems, the inode will almost certainly be different.

Simply renaming the file on the same system is more likely to keep the same inode simply because the inode belongs to the data rather than the directory entry and efficiency would lead to that design. However, it depends on the file system and is in no way mandated by standards.

For example, there may be a versioning file system with the inode concept that gives you a new inode because it wants to track the name change.


It depends.

There is a nice example on this site which shows that the inode may stay the same. But I would not rely on this behaviour, I doubt that it is specified in any standard.