Linux Type and Version?

Is there a way to query the system for the Linux type and version?

uname -a is one way. I’m sure there are more ways :slight_smile:

You can try to call out to “lsb_release”, but that only seems to work on some distros. Otherwise, each vendor has their own way of identifying their distributions. The best you can probably do is what Albin says and determine the bit size and kernel version with uname -a.


Here is some code to get the Ubuntu version

Dim sh as New Shell sh.execute "lsb_release -d" If sh.errorCode=0 then If Instr(0,sh.Result,"11.10") > 0 Then //It's 11.10 ElseIf Instr(0,sh.Result,"12.04") > 0 Then //It's 12.04 ElseIf Instr(0,sh.Result,"Mint") > 0 Then //It's Mint End If end if

uname -a will give you the kernel version.

If you want the distro name, you’ll end up trying multiple commands because there’s no standard (as far as I know)

cat /etc/os-release
lsb_release -a
cat /etc/issue
cat /proc/version

I created a 100+ line method to report the version for Mac/Win/Linux and in the end scrapped it for one line!


For Linux I was using the Shell command:

uname -p -s -r

but I had to remove the EndOfLine character it placed on the end