journalctl

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
ckonn
Level 3
Level 3
Posts: 128
Joined: Wed Oct 01, 2014 7:03 pm

journalctl

Post by ckonn »

hello,

i don't have 'journalctl' utility installed on my system.

Code: Select all

sudo apt-get install journalctl
does not work

how could i install it?

thanks in advance
Last edited by ckonn on Wed Dec 27, 2017 5:24 pm, edited 2 times in total.
Cosmo.
Level 23
Level 23
Posts: 17817
Joined: Sat Dec 06, 2014 7:34 am

Re: journalctl

Post by Cosmo. »

What is your version of Mint and what is the desktop environment? If you don't know open a terminal and enter:

Code: Select all

inxi -Sz
Paste the output here.

journalctl is not a separate package, but a part of systemd. If you have it (and can use it) depends from your unknown system.
ckonn
Level 3
Level 3
Posts: 128
Joined: Wed Oct 01, 2014 7:03 pm

Re: journalctl

Post by ckonn »

i am using linux mint 17.3 mate desktop.
Cosmo.
Level 23
Level 23
Posts: 17817
Joined: Sat Dec 06, 2014 7:34 am

Re: journalctl

Post by Cosmo. »

systemd as init system gets only used since LM 18. You don't have it and you don't need journalctl.
ckonn
Level 3
Level 3
Posts: 128
Joined: Wed Oct 01, 2014 7:03 pm

Re: journalctl

Post by ckonn »

what are the alternative utilities in linux mint 17.3 to 'journalctl' to read sys-logs?
Cosmo.
Level 23
Level 23
Posts: 17817
Joined: Sat Dec 06, 2014 7:34 am

Re: journalctl

Post by Cosmo. »

There is the system log viewer in the menu.
lmuserx4849

Re: journalctl

Post by lmuserx4849 »

ckonn wrote:what are the alternative utilities in linux mint 17.3 to 'journalctl' to read sys-logs?
The simple answer:less /var/log/syslog
lmuserx4849

Re: journalctl

Post by lmuserx4849 »

Additional information.

If you execute the commands below from a console command line:

Code: Select all

cd /var/log
ls -l syslog*
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.

Code: Select all

tail -n10 -f syslog
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.
Post Reply

Return to “Software & Applications”