Additional information.
If you execute the commands below from a console command line:
you will notice multiple syslog files with an extension of .gz. These are compressed archived files. They are automatically created by logrotate. One of the benefits of LM is that it is configured. LM has configured logrotate for users as to when to rotate and how many to keep, etc. There is a command that can view these compressed and archived syslog files,
zless
. You use it just like
less
.
You can also follow syslog. If you are having problems, with say hardware, you may want to watch the messages as they occur. You can also follow syslog from within less, by typing a "F". Ctrl-C will get you out of both.
Note: I only typed syslog in the above example because I did a change directory (cd) to /var/log. I could have easily typed /var/log/syslog.
You can also search/filter syslog using any of these commands:
Code: Select all
grep -i 'pulseaudio' /var/log/syslog
awk 'BEGIN{IGNORECASE=1} /pulseaudio/' /var/log/syslog
sed -n '/pulseaudio/Ip' /var/log/syslog
Note: It is a good habit to quote what you are searching for to prevent bash from parsing the line incorrectly. Bash readline sees everything you type on the command line.
If you are using a gnome based desktop (cinnamon, mate) or kde, there are gui's that display the system log. KDE 4 on LM17.3 has KSystemLog. Cinnamon on LM 18.3 has SystemLog. On cinnamon the user would just open the Main Menu and search for System. I have LM 17.3 KDE and the more traditional menu launcher. KSystemLog is under the submenu System.
If you have never used the command less before, here is some info. First, all good linux commands have help. If it is a gui you might see it on the menu, or Help button, or you can use F1. From a console command line you might be able to do
less --help
(change less to whatever command you want help for). Then there is the venerable
man pages. The command to read man pages is called
man
(system manual pager). man uses less, so nothing new to learn. The man short description can be searched via
man -k syslog
(change syslog to whatever you want to search for). You can do a man on man,
man man
.
These are the commands I use most often when reading a man page:
q - exit
g - top of file
G - bottom of file
up and down arrows work, so do page down and page up
/text - search down
?text - search up
n - repeat last search. Typing "n" again, finds the next occurrence.
man --html=firefox less
will format the man page into html and open it in the browser firefox
Man pages are online at many locations
There is a good open source book on the command line, that you can download:
http://linuxcommand.org/tlcl.php
The majority of the utilities we have on linux historically have come from GNU Org,
https://www.gnu.org/software/software.html.
systemd, which journald is a part of, is taking over many, many functions. It started as an
init system and you will often see people describe it that way today, but it is MUCH more and will become more. Watch what RedHat is doing, they pretty rule what distros do and do not do these days.