Check Slackware Version

There are two most commonly used ways to check the Slackware version.

The first one is the file /etc/slackware-version that shows the system version.

$ cat /etc/slackware-version 
Slackware 15.0

The second method shows more detailed information about the system in this file /etc/os-release.

$ cat /etc/os-release 
NAME=Slackware
VERSION="15.0"
ID=slackware
VERSION_ID=15.0
PRETTY_NAME="Slackware 15.0 x86_64"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:slackware:slackware_linux:15.0"
HOME_URL="http://slackware.com/"
SUPPORT_URL="http://www.linuxquestions.org/questions/slackware-14/"
BUG_REPORT_URL="http://www.linuxquestions.org/questions/slackware-14/"
VERSION_CODENAME=stable

You can easily load the information from this file and use it in your shell script using the command source.

$ source /etc/os-release
$ echo "Distribution: $NAME"
Distribution: Slackware

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Patterson

Patterson

Graduated in Computer Science and passionate about programming languages and free software. Here I find a way to share my knowledge while learning even more.