Linux: how to delete a file only when is not used by any process

When working on Linux systems — whether servers in production, development machines, or even embedded devices — you’ll eventually run into…