Operations 5 min read

Master Linux System Logs: Commands, Files, and GUI Tools

Learn how to view and analyze Linux system logs using command-line utilities like journalctl and dmesg, explore key log files such as /var/log/messages and /var/log/auth.log, and discover graphical tools like GNOME Logs and Logwatch for effective troubleshooting and performance monitoring.

Open Source Linux
Open Source Linux
Open Source Linux
Master Linux System Logs: Commands, Files, and GUI Tools

1. Using command-line tools to view system logs

1. Using journalctl to view system logs :

journalctl is the client for systemd's journal. The following command shows all logs: journalctl Use -n to show the latest entries, e.g., journalctl -n 50 Use -u to view logs for a specific unit, e.g.,

journalctl -u nginx.service

2. Using dmesg to view kernel logs : dmesg Use -n to limit output, e.g., dmesg -n 50 Pipe to grep to filter, e.g.,

dmesg | grep error

2. Viewing system log files directly

Common log files include:

/var/log/messages : all system messages.

/var/log/syslog : system messages generated by the syslog daemon.

/var/log/auth.log : authentication and authorization logs.

/var/log/dmesg : kernel ring buffer contents (same as dmesg output).

Example commands:

cat /var/log/messages
cat /var/log/syslog
cat /var/log/auth.log
cat /var/log/dmesg

Use tail -n 50 to view the last 50 lines of each file.

tail -n 50 /var/log/messages
tail -n 50 /var/log/syslog
tail -n 50 /var/log/auth.log
tail -n 50 /var/log/dmesg

3. Using log management tools

Graphical tools:

GNOME Logs : official GNOME log viewer.

KSystemLog : KDE log viewer.

Command-line tool:

Logwatch can analyze logs and generate reports. Install with: sudo apt-get install logwatch System logs are essential for troubleshooting and performance monitoring.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

linuxLog Managementjournalctlsystem logsdmesg
Open Source Linux
Written by

Open Source Linux

Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.