xutil.dev
ログイン

systemd チートシート

systemdコマンドのクイックリファレンス。サービス管理、ユニットファイル、journalctl、タイマー、ターゲット、systemd-analyze、ソケットを網羅

68 件のコマンド

systemctl start

サービスを起動

systemctl stop

サービスを停止

systemctl restart

サービスを再起動

systemctl reload

サービスの設定を再読み込み

systemctl status

サービスの状態を表示

systemctl enable

サービスの自動起動を有効化

systemctl disable

サービスの自動起動を無効化

systemctl enable --now

自動起動を有効化して即起動

systemctl is-active

サービスがアクティブかチェック

systemctl is-enabled

サービスの自動起動が有効かチェック

systemctl is-failed

サービスが失敗状態かチェック

systemctl mask

サービスをマスク(起動不可に)

systemctl unmask

サービスのマスクを解除

systemctl list-units

アクティブなユニット一覧を表示

systemctl list-units --type=service

サービスユニット一覧を表示

systemctl list-units --failed

失敗したユニット一覧を表示

systemctl list-unit-files

全ユニットファイル一覧を表示

systemctl cat

ユニットファイルの内容を表示

systemctl show

ユニットのプロパティを表示

systemctl edit

ユニットのオーバーライドを編集

systemctl edit --full

ユニットファイル全体を編集

systemctl daemon-reload

ユニットファイルの変更を反映

systemctl list-dependencies

ユニットの依存関係を表示

systemctl reset-failed

失敗状態のユニットをリセット

journalctl

全ジャーナルログを表示

journalctl -u

特定ユニットのログを表示

journalctl -f

ログをリアルタイムで表示

journalctl -u -f

特定ユニットのログをリアルタイム表示

journalctl --since

指定日時以降のログを表示

journalctl --since --until

指定期間のログを表示

journalctl -p

優先度でログをフィルタリング

journalctl -b

現在のブート以降のログを表示

journalctl -b -1

前回のブートのログを表示

journalctl --disk-usage

ジャーナルのディスク使用量を表示

journalctl --vacuum-size

ジャーナルのサイズを制限して古いログを削除

journalctl --vacuum-time

指定期間より古いログを削除

journalctl -o json

ログをJSON形式で出力

systemctl list-timers

アクティブなタイマー一覧を表示

systemctl list-timers --all

全タイマー一覧を表示

systemctl start timer

タイマーを起動

systemctl stop timer

タイマーを停止

systemctl enable timer

タイマーの自動起動を有効化

systemd-run --on-calendar

一時的なタイマーを作成(カレンダー)

systemd-run --on-active

指定時間後に一度だけ実行

systemctl get-default

デフォルトのターゲットを表示

systemctl set-default

デフォルトのターゲットを設定

systemctl isolate

指定ターゲットに切り替え

systemctl rescue

レスキューモードに切り替え

systemctl emergency

緊急モードに切り替え

systemctl poweroff

システムをシャットダウン

systemctl reboot

システムを再起動

systemctl suspend

システムをサスペンド

systemd-analyze

起動時間を分析

systemd-analyze blame

ユニットごとの起動時間を表示

systemd-analyze critical-chain

起動のクリティカルチェーンを表示

systemd-analyze plot

起動時間のSVGグラフを生成

systemd-analyze verify

ユニットファイルの構文を検証

systemd-analyze dot

依存関係のDOTグラフを生成

systemd-analyze security

サービスのセキュリティ設定を分析

systemd-cgls

コントロールグループ階層を表示

systemd-cgtop

コントロールグループのリソース使用量を表示

systemctl list-sockets

ソケットユニット一覧を表示

systemctl start socket

ソケットユニットを起動

loginctl list-sessions

ログインセッション一覧を表示

loginctl list-users

ログイン中のユーザー一覧を表示

hostnamectl

ホスト名の表示・設定

timedatectl

日時・タイムゾーンの表示・設定

localectl

ロケール・キーボード設定の表示・変更