idempotency
also: idempotent operation
A property of operations that produce the same result whether executed once or multiple times, ensuring safety and predictability in repeated executions.
Idempotency means running an operation one time or one hundred times produces identical outcomes. In Linux and system administration, idempotent operations are safe to repeat without side effects or unintended changes.
This principle is crucial for configuration management tools like Ansible and Puppet, which must safely re-apply configurations without causing problems. For example, an idempotent command to create a user account checks if the user exists first—running it once or fifty times creates the user exactly once.
Example: mkdir -p /var/data is idempotent—executing it multiple times leaves the directory unchanged. In contrast, rm /var/data is not idempotent—the first execution deletes the directory, and subsequent executions fail because it no longer exists.