一、systemctl:Systemd 的主命令,可用于管理系统,
查看 Systemd 的版本:systemctl --version
重启系统:systemctl reboot
关闭系统,切断电源:systemctl poweroff
CPU停止工作:systemctl halt
暂停系统:systemctl suspend
让系统进入冬眠状态:systemctl hibernate
让系统进入交互式休眠状态:systemctl hybrid-sleep
启动进入救援状态(单用户状态):systemctl rescue
二、systemd-analyze命令用于查看启动耗时。
查看启动耗时:systemd-analyze
查看每个服务的启动耗时:systemd-analyze blame
显示瀑布状的启动过程流:systemd-analyze critical-chain
显示指定服务的启动流:systemd-analyze critical-chain network.service
三、hostnamectl命令用于查看当前主机的信息。
显示当前主机的信息:hostnamectl
设置主机名:hostnamectl set-hostname rhel7
四、localectl命令用于查看本地化设置。
查看本地化设置:localectl
设置本地化参数:
localectl set-locale LANG=zh_CN.UTF-8
localectl set-keymap en_GB
五、 timedatectl命令用于查看当前时区设置。
查看当前时区设置:timedatectl
显示所有可用的时区:timedatectl list-timezones
设置当前时区
timedatectl set-timezone Asia/Shanghai
timedatectl set-time YYYY-MM-DD
timedatectl set-time HH:MM:SS
六、loginctl命令用于查看当前登录的用户。
列出当前session:loginctl list-sessions
列出当前登录用户:loginctl list-users
列出显示指定用户的信息:loginctl show-user ruanyf
- 本文固定链接: https://www.qingheluo.com/systemdzhongdexitongguanlimingling/
- 转载请注明: qingheluo 于 清河洛 发表