Get system version

There are 2 versions of FreeBSD: kernel and userland. Use “freebsd-version -ku“ can output both versions:

  1. # freebsd-version -uk
  2. 10.3-RELEASE-p4
  3. 10.3-RELEASE-p5

The first one is kernel version info. You can see the versions of both kernel and userland is 10.3, but kernel patch level is p4, while userland is p5. That’s because in some cases, only the userland requires a patch whilst kernel not, so kernel patch level doesn’t change. If there is no option, “freebsd-version“ prints userland version only:

  1. # freebsd-version
  2. 10.3-RELEASE-p5

uname -r“ command also outputs the kernel version:

  1. # uname -r
  2. 10.3-RELEASE-p4

Reference:
Why the outputs of “freebsd-version” and “freebsd-version -k” are different?.