Comment by aaronmdjones
Comment by aaronmdjones 16 hours ago
> Windows locks files when they're in use, so that you cannot overwrite them. Linux doesn't do this.
Linux does do this (try overwriting or truncating a binary executable while it's running and you'll get -ETXTBSY).
The difference is that Linux allows you to delete (unlink) a running executable. This will not free the on-disk space occupied by that executable (so anything you write to disk in the immediate future will not overwrite the executable, and it can continue executing even if not all of the executable has been paged in) until all references to its inode are freed (e.g. the program exits and there are no other hardlinks to it).
Then you can install a new version of the executable with the same name (since a file by that name no longer exists). This is what install(1) does.