System Logs ( dmesg , journalctl , /var/log/ )
These commands can be used to find errors and troubleshoot
This command is used to get examine kernel ring buffer logs like hardware errors.
Use examples:
$ sudo dmesg | less
Pipe command to less so output is scrollable with arrow keys.
$ sudo dmesg | grep usb
Get info on usb devices
$ sudo dmesg -l emerg,alert,crit,err,warn
Print only emergency, alert, critical, error, warn messages.
This command is used to query the (systemd) journal logs, as documented here .
Use examples:
$ journalctl -x -p3 -b1
The flags correspond to explanatory output, priority level, and which boot to pull logs from.
journalctl -f
Live printing of the journal.
This directory can contain logs from a number of sources.
Use examples:
$ cat /var/log/Xorg.0.log
Print Xorg log from the current session.
$ cat /var/log/Xorg.0.log.old
Print Xorg log from the previous successful session.
$ cat /var/log/Xorg.1.log