mv can move a 1TB file in an instant

When you move a file with mv, it finishes instantly. But think about it: what if the file were 1TB? Turns out, if you're moving within the same file system (partition), even 1TB takes an instant.
That's because mv doesn't actually copy the file's contents. All it does is rewrite the file's address (its path). It's like updating a card in a library catalog instead of physically carrying the book to a different shelf.
There's a catch, though. Moving to a different file system is a whole different story. Across disks or partitions, the system has to copy the entire contents and then delete the original, so the time scales with file size.
The same mv command, yet completely different behavior depending on the destination. Knowing what's happening under the hood is what makes the terminal truly fascinating.
Looking beyond the surface to ask "why is this fast?" is thinking like an engineer.
