0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Linux] システムログ設定_w, last, lastlog, journalctl

Posted at

journalctlコマンド

オプション一覧

$ journalctl [オプション]
オプション 由来 説明
default journal システムログを時系列で表示(古い順)
-b boot 現在のブート以降のログのみを表示(-b -1 で1つ前の起動時など)
-r reverse 新しい順(降順)でログを表示
-f follow tail -f のようにリアルタイムでログを追跡表示
-u ユニット名 unit 指定した systemd ユニットに関するログのみ表示(例:-u ssh.service
--since since 指定日時以降のログを表示(例:--since "2025-06-01 12:00"
--until until 指定日時までのログを表示
-p 優先度 priority 指定した優先度(severity)以上のログのみ表示(例:-p err はエラー以上)
-xe explain エラー詳細を追跡しやすい表示(-x: 説明表示, -e: 最後の行にジャンプ)

検索式一覧

$ journalctl [検索式] [オプション]
検索式 説明
_SYSTEMD_UNIT=ユニット名 指定した systemd ユニットのログを抽出
_PID=1234 プロセスID 1234 のログを表示
_UID=1000 ユーザーID 1000 によるログインや実行ログを抽出

Ping-t

journalctl

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?