单选题
某公司新购服务器需要将默认运行级别从图形界面切换为多用户文本模式。管理员在RHEL 9上执行了相关命令并希望立即生效且重启后保持,应使用哪条命令?
A. systemctl start multi-user.target
B. systemctl isolate multi-user.target
C. systemctl set-default multi-user.target
D. systemctl enable multi-user.target
正确答案:C
依据 systemctl(1),set-default 修改 default.target 符号链接,使 multi-user.target 成为默认目标,重启后持续生效;isolate 仅临时切换,enable 只建立单元依赖链接,start 仅本次启动,均不能持久改变默认运行级别。
单选题
管理员小陈需要将RHEL 9系统默认运行级别从图形界面切换为多用户文本模式,并使其永久生效。他应执行哪组操作?
A. systemctl enable multi-user.target
B. systemctl set-default multi-user.target
C. systemctl start multi-user.target
D. systemctl isolate multi-user.target
正确答案:B
依据 systemctl(1) 手册,set-default 修改默认target并持久生效;isolate 仅临时切换,enable 用于开机自启单元,start 仅本次启动,均不能永久改变默认运行级别。
单选题
运维工程师小王在机房对一台CentOS 7服务器调整默认运行级别,希望下次开机直接进入多用户文本模式而不是图形界面,他应执行哪条命令?
A. systemctl isolate multi-user.target
B. systemctl set-default graphical.target
C. systemctl set-default multi-user.target
D. systemctl enable multi-user.target
正确答案:C
依据 systemctl(1) 手册,set-default 用于设置 default.target 的符号链接,multi-user.target 对应文本多用户模式;isolate 只切换当前运行级别不改变下次开机默认值,enable 仅设置开机自启。