# journalctl

> Queries the systemd journal: logs by service, boot, time range, priority and more.

- Category: Linux
- Commands: 21
- Page: https://terminal.rokibulroni.com/tool/linux/journalctl
- Homepage: https://systemd.io
- Documentation: https://www.freedesktop.org/software/systemd/man/latest/journalctl.html
- Tags: logs, systemd, incident response

## Reading

### journalctl

```bash
journalctl
```

The whole journal, oldest first, in a pager.

### journalctl -r

```bash
journalctl -r
```

Newest first.

### journalctl -f

```bash
journalctl -f
```

Follows new entries live, like tail -f.

### journalctl -n <n>

```bash
journalctl -n <n>
```

Example:

```bash
journalctl -n 100
```

The last n entries.

### journalctl -e

```bash
journalctl -e
```

Opens at the end of the journal.

### journalctl -x -e

```bash
journalctl -x -e
```

Adds explanatory help text to entries where available.


## Filtering

### journalctl -u <unit>

```bash
journalctl -u <unit>
```

Example:

```bash
journalctl -u ssh
```

Entries from one service.

### journalctl -u <unit> --since "<time>"

```bash
journalctl -u <unit> --since "<time>"
```

Example:

```bash
journalctl -u nginx --since "1 hour ago"
```

Time-limited; accepts “today”, “yesterday” or exact timestamps.

### journalctl --since "<start>" --until "<end>"

```bash
journalctl --since "<start>" --until "<end>"
```

Example:

```bash
journalctl --since "2026-11-05 22:00" --until "2026-11-06 02:00"
```

A specific window — the core of incident triage.

### journalctl -b

```bash
journalctl -b
```

The current boot only. -b -1 is the previous boot.

### journalctl --list-boots

```bash
journalctl --list-boots
```

Every recorded boot with its time range — shows unexpected reboots.

### journalctl -p err -b

```bash
journalctl -p err -b
```

Errors and worse since boot. Levels: emerg, alert, crit, err, warning, notice, info, debug.

### journalctl -k

```bash
journalctl -k
```

Kernel messages, like dmesg.

### journalctl _UID=<uid>

```bash
journalctl _UID=<uid>
```

Example:

```bash
journalctl _UID=1001
```

Entries generated by a user.

### journalctl _COMM=<name>

```bash
journalctl _COMM=<name>
```

Example:

```bash
journalctl _COMM=sudo
```

Entries from one executable — here, every sudo use.

### journalctl -g "<regex>"

```bash
journalctl -g "<regex>"
```

Example:

```bash
journalctl -u ssh -g "Failed password|Invalid user"
```

Greps message text (systemd 237+).


## Output and maintenance

### journalctl -o json-pretty -n 5

```bash
journalctl -o json-pretty -n 5
```

Structured output with every field — useful for shipping to a SIEM.

### journalctl -o short-iso

```bash
journalctl -o short-iso
```

ISO 8601 timestamps.

### journalctl --disk-usage

```bash
journalctl --disk-usage
```

How much space the journal uses.

### sudo journalctl --vacuum-time=<age>

```bash
sudo journalctl --vacuum-time=<age>
```

Example:

```bash
sudo journalctl --vacuum-time=30d
```

Deletes entries older than the given age.

### journalctl --verify

```bash
journalctl --verify
```

Checks journal files for corruption or tampering when sealing is enabled.

## Related tools

- [systemctl](https://terminal.rokibulroni.com/tool/linux/systemctl)
- [tail](https://terminal.rokibulroni.com/tool/linux/tail)
- [auditd](https://terminal.rokibulroni.com/tool/monitoring/auditd)
