list-sessions List sessions session-status [ID...] Show session status show-session [ID...] Show properties of sessions or the manager activate [ID] Activate a session lock-session [ID...] Screen lock one or more sessions unlock-session [ID...] Screen unlock one or more sessions lock-sessions Screen lock all current sessions unlock-sessions Screen unlock all current sessions terminate-session ID... Terminate one or more sessions kill-session ID... Send signal to processes of a session
时间(timedatectl)
1 2 3 4 5 6 7 8
status Show current time settings show Show properties of systemd-timedated set-time TIME Set system time set-timezone ZONE Set system time zone list-timezones Show known time zones set-local-rtc BOOL Control whether RTC is in local time set-ntp BOOL Enable or disable network time synchronization
本地化设置(localectl)
1 2 3 4 5 6 7 8 9 10 11 12
status Show current locale settings set-locale LOCALE... Set system locale list-locales Show known locales set-keymap MAP [MAP] Set console and X11 keyboard mappings list-keymaps Show known virtual console keyboard mappings set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]] Set X11 and console keyboard mappings list-x11-keymap-models Show known X11 keyboard mapping models list-x11-keymap-layouts Show known X11 keyboard mapping layouts list-x11-keymap-variants [LAYOUT] Show known X11 keyboard mapping variants list-x11-keymap-options Show known X11 keyboard mapping options
启动信息(systemd-analyze)
1 2 3 4 5 6 7 8
time Print time spent in the kernel blame Print list of running units ordered by time to init critical-chain Print a tree of the time critical chain of units plot Output SVG graphic showing service initialization dot Output dependency graph in dot(1) format set-log-level LEVEL Set logging threshold for systemd dump Output state serialization of service manager verify FILE... Check unit files for correctness
主机信息(hostnamectl)
1 2 3 4 5 6
status Show current hostname settings set-hostname NAME Set system hostname set-icon-name NAME Set icon name for host set-chassis NAME Set chassis type for host set-deployment NAME Set deployment environment for host set-location NAME Set location for host
-F --field=FIELD List all values that a specified field takes --new-id128 Generate a new 128-bit ID --disk-usage Show total disk usage of all journal files --vacuum-size=BYTES Reduce disk usage below specified size --vacuum-time=TIME Remove journal files older than specified date --flush Flush all journal data from /run into /var --header Show journal header information --list-catalog Show all message IDs in the catalog --dump-catalog Show entries in the message catalog --update-catalog Update the message catalog database --setup-keys Generate a new FSS key pair --verify Verify journal file consistency
[Unit] Description:简短描述 Documentation:文档地址 Requires:当前 Unit 依赖的其他 Unit,如果它们没有运行,当前 Unit 会启动失败 Wants:与当前 Unit 配合的其他 Unit,如果它们没有运行,当前 Unit 不会启动失败 BindsTo:与Requires类似,它指定的 Unit 如果退出,会导致当前 Unit 停止运行 Before:如果该字段指定的 Unit 也要启动,那么必须在当前 Unit 之后启动 After:如果该字段指定的 Unit 也要启动,那么必须在当前 Unit 之前启动 Conflicts:这里指定的 Unit 不能与当前 Unit 同时运行 Condition...:当前 Unit 运行必须满足的条件,否则不会运行 Assert...:当前 Unit 运行必须满足的条件,否则会报启动失败
[Install] WantedBy:它的值是一个或多个 Target,当前 Unit 激活时(enable)符号链接会放入/etc/systemd/system目录下面以 Target 名 + .wants后缀构成的子目录中 RequiredBy:它的值是一个或多个 Target,当前 Unit 激活时,符号链接会放入/etc/systemd/system目录下面以 Target 名 + .required后缀构成的子目录中 Alias:当前 Unit 可用于启动的别名 Also:当前 Unit 激活(enable)时,会被同时激活的其他 Unit