Linux command
machine-id 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
View machine ID
cat /etc/machine-id
Generate new machine ID
systemd-machine-id-setup
Check if ID exists
test -f /etc/machine-id && echo "exists"
Compare machine IDs
diff /etc/machine-id /var/lib/dbus/machine-id
说明
machine-id is a file containing a unique machine identifier established during installation or first boot. It's a 32-character lowercase hexadecimal string without hyphens. The ID is used by systemd, D-Bus, and other services to uniquely identify the system. It should be stable across reboots but unique per machine.
FAQ
What is the machine-id command used for?
machine-id is a file containing a unique machine identifier established during installation or first boot. It's a 32-character lowercase hexadecimal string without hyphens. The ID is used by systemd, D-Bus, and other services to uniquely identify the system. It should be stable across reboots but unique per machine.
How do I run a basic machine-id example?
Run `cat /etc/machine-id` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
Where can I find more machine-id examples?
This page includes 4 examples for machine-id, plus related commands for nearby Linux tasks.