Creating shortcut for finding installed Slackware packages

Lazy I am so I created a shortcut for checking if a package is installed in Slackware. Packages are listed on /var/log/packages so basically a basic ls | grep combo is needed to see if a package is already installed. Below is my little script and I name it as pkgfind.


if [ "$1" == "" ]; then
    echo "Usage: pkgfind <package-name>" 
    exit 1

ls /var/log/packages | grep "$1"

This is located at my bin directory at ~/bin/pkgfind. Add an execute bit to it and be sure the path is added to user’s path so that the current user can use it anywhere. Or if you wanted a global script, put it in /usr/bin/pkgfind.


lysender@darkstar:~$ pkgfind opencv
lysender@darkstar:~$ pkgfind lolcat
lysender@darkstar:~$ pkgfind ffmpeg

I synced it u with SpiderOak so that I could also use it in the office.

Leave a reply

Your email address will not be published. Required fields are marked *