← 返回命令列表

Linux command

systemctl-disable 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Disable

systemctl disable [unit]

Example

systemctl disable --now [unit]

Example

systemctl --user disable [unit]

Example

systemctl disable [unit1] [unit2]

Example

systemctl disable --runtime [unit]

说明

systemctl disable removes the symbolic links that cause units to start automatically at boot or login. This prevents the unit from starting in the future but does not stop a currently running instance unless --now is used. The command reverses the effect of systemctl enable by removing symlinks from target.wants directories. The unit file itself is not modified or deleted.

参数

--now
Also stop the unit after disabling
--user
Disable user service manager units instead of system units
--no-reload
Do not reload systemd configuration after disabling
--runtime
Disable temporarily until next reboot only.
--force
When disabling, remove symlinks even if the unit file does not exist.
--global
Disable for all users (with --user-mode units).

FAQ

What is the systemctl-disable command used for?

systemctl disable removes the symbolic links that cause units to start automatically at boot or login. This prevents the unit from starting in the future but does not stop a currently running instance unless --now is used. The command reverses the effect of systemctl enable by removing symlinks from target.wants directories. The unit file itself is not modified or deleted.

How do I run a basic systemctl-disable example?

Run `systemctl disable [unit]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --now do in systemctl-disable?

Also stop the unit after disabling