Home

Kernel

dmesg

dmesg prints the kernel ring buffer, which contains messages related to the system's hardware, drivers, and kernel activity.

dmesg # Print all in kernel ring buffer
dmesg -k # Print only kernel messages

sysctl

sysctl is used to change kernel parameters at runtime.

# Display all available kernel parameters and their current values
sysctl -a
# -w: Write or change a kernel parameter.
sysctl -w net.ipv4.ip_forward=1
# -p: Load settings from a file (default is /etc/sysctl.conf)
sysctl -p

Logs

journalctl

A command to query and view logs from systemd-journald

# Display all logs from the beginning of history
journalctl

# Filter logs by date
journalctl --since "2024-09-01" --until "2024-09-04"

# Display log from sshd service
journalctl -u sshd.service

# Monitor logs in real-time
journalctl -f

# Display only kernel logs
journalctl -k

syslog

The traditional logging mechanism used in Unix and Linux systems.

Log files