seanspotatobusiness
Posts: 221
Joined: Tue May 22, 2012 11:19 pm

[SOLVED] Log viewer software and how to perform boolean searches in package manager?

Sat Jun 12, 2021 4:13 pm

I have some text file logs which are quite long (~36 MB and growing) and Mousepad is a bit sluggish opening and moving through them; I was wondering whether some program that was designed to be used to view logs might be more spritely and less prone to hang?

Secondly, I tried to search for 'log viewer' in the Package Manager but it seems like the search takes the terms with boolean operator OR and returns basically every damn program in the repository; how do I force it to search for log AND viewer? Thanks.
Last edited by seanspotatobusiness on Fri Jun 18, 2021 12:56 pm, edited 1 time in total.
Raspberry Pi 3 B and B+
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"

User avatar
craigevil
Posts: 217
Joined: Wed Jan 27, 2021 5:22 am
Location: OZ

Re: Log viewer software and how to perform boolean searches in package manager?

Sat Jun 12, 2021 4:39 pm

There are several packages that can read logs:
gnome-system-log
gnome-logs
ksystemlog
mate-utils

Make sure you have logrotate installed and setup properly, most logs are at most a few kbs.

Add/Remove sucks for searching for packages, use apt.

Try this the next time you need to find a package:

Code: Select all

apt list | grep <package_name>
This will show what is installed for the package:

Code: Select all

apt list --installed | grep <package_name>
You can also just do:

Code: Select all

 sudo apt install packagename<tab><tab>
Some more info on searching:
https://wiki.debian.org/PackageManagement/Searching
Raspberry PI 400 Raspberry Pi OS (Unstable) Kernel: 5.10.17-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"

User avatar
scruss
Posts: 4190
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Log viewer software and how to perform boolean searches in package manager?

Sat Jun 12, 2021 5:18 pm

Another way to do it is:

Code: Select all

apt-cache search log | grep viewer | grep log
auth2db - Powerful and eye-candy IDS logger, log viewer and alert generator
belvu - multiple sequence alignment viewer and phylogenetic tool
bidiv - BiDi viewer - command-line tool displaying logical Hebrew/Arabic
figtree - graphical phylogenetic tree viewer
gnome-logs - viewer for the systemd journal
gnome-system-log - system log viewer for GNOME
goaccess - log analyzer and interactive viewer for the Apache Webserver
ksystemlog - system log viewer
lnav - ncurses-based log file viewer
loggerhead - Web viewer for Bazaar
loggerhead-doc - Web viewer for Bazaar (documentation)
spykeviewer - graphical utility for analyzing electrophysiological data
Any time you do grep … | grep … you're doing an AND on the two results.

You might wonder why I've done grep log at the end of the search which includes log as its primary search term. apt-cache returns results that include the term in related fields that aren't printed, so including the grep for the search term cuts down on useless results. It's still not perfect - it matches 'electrophysiological' too. If I could remember how to grep for word boundaries I'd use that.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

User avatar
Paeryn
Posts: 3310
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Log viewer software and how to perform boolean searches in package manager?

Sat Jun 12, 2021 6:11 pm

scruss wrote:
Sat Jun 12, 2021 5:18 pm
It's still not perfect - it matches 'electrophysiological' too. If I could remember how to grep for word boundaries I'd use that.
If you want grep to only match whole words then pass -w to it, or you can use \< and \> to match the start of or end of a word (you'll need to quote the search term if using these two to prevent the shell interpreting them)

Code: Select all

apt-cache search log | grep viewer | grep -w log
apt-cache search log | grep viewer | grep "\<log\>"
She who travels light — forgot something.
Please note that my name doesn't start with the @ character so can people please stop writing it as if it does!

seanspotatobusiness
Posts: 221
Joined: Tue May 22, 2012 11:19 pm

Re: Log viewer software and how to perform boolean searches in package manager?

Fri Jun 18, 2021 12:56 pm

Thanks everyone for your really comprehensive answers (including to questions I hadn't realised I could ask!)
Raspberry Pi 3 B and B+
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"

Return to “Beginners”