 |
|
| |
| Introduction
| |
Your VPS runs one of two operating systems — FreeBSD 15 or
Rocky Linux 10 — and most of the time you already know which. When you don’t
(you administer several servers, you are following a guide and need to know which set of commands
applies, or you just want to confirm the exact version before an upgrade), the uname command
answers the question in a second. This page covers uname on both systems and the extra commands
that report the full distribution version.
| |
| The uname Command
| |
Run on its own, uname prints the kernel name — the quickest way to tell the two systems
apart:
$ uname
FreeBSD ← on a FreeBSD 15 VPS
$ uname
Linux ← on a Rocky Linux 10 VPS
Note that Rocky Linux (like every Linux distribution) reports Linux — that is the name of
the kernel, not the distribution. To see everything uname knows at once, add -a (“all”):
$ uname -a (FreeBSD 15)
FreeBSD vps.example.com 15.0-RELEASE FreeBSD 15.0-RELEASE releng/15.0 GENERIC amd64
$ uname -a (Rocky Linux 10)
Linux vps.example.com 6.12.0-55.el10.x86_64 #1 SMP PREEMPT_DYNAMIC ... x86_64 x86_64 x86_64 GNU/Linux
Each piece of that line has its own flag, so you can ask for just the part you want. These flags are
standard and work the same on both systems:
| Flag |
Shows |
Example |
| -s | Kernel name (the default) | FreeBSD / Linux |
| -n | Network node (host) name | vps.example.com |
| -r | Kernel release | 15.0-RELEASE / 6.12.0-55.el10.x86_64 |
| -v | Kernel version (build details) | releng/15.0… / #1 SMP… |
| -m | Machine hardware (architecture) | amd64 / x86_64 |
| -p | Processor architecture | amd64 / x86_64 |
| -a | All of the above on one line | (see above) |
So uname -s tells you the OS family, uname -m the architecture (both VPS platforms are
64-bit Intel/AMD — amd64 and x86_64 are the same thing under two names), and
uname -r the kernel release. FreeBSD adds -U and -K for the userland and kernel
version numbers; on Linux, uname -o prints GNU/Linux.
| |
| Finding the Distribution Version
| |
There is one catch on Rocky Linux: uname -r reports the kernel release
(6.12.0-55.el10.x86_64), not “Rocky Linux 10.” The kernel and the
distribution are versioned separately, so to read the distribution name and version you look elsewhere.
On FreeBSD the two move together, but a dedicated command reports the exact patch level.
On FreeBSD 15, use freebsd-version. It distinguishes the installed userland from the
running kernel — useful after applying a security patch, when the two can briefly differ:
$ freebsd-version # installed userland, e.g. 15.0-RELEASE-p2
$ freebsd-version -k # the kernel that is installed
$ freebsd-version -u # the userland that is running
On Rocky Linux 10, the distribution version lives in two files, and
hostnamectl shows it alongside the kernel:
$ cat /etc/redhat-release
Rocky Linux release 10.0 (Red Quartz)
$ cat /etc/os-release
NAME="Rocky Linux"
VERSION="10.0 (Red Quartz)"
PRETTY_NAME="Rocky Linux 10.0 (Red Quartz)"
ID="rocky"
...
$ hostnamectl
Static hostname: vps.example.com
Operating System: Rocky Linux 10.0 (Red Quartz)
Kernel: Linux 6.12.0-55.el10.x86_64
Architecture: x86-64
The /etc/os-release file is the dependable, machine-readable source — scripts commonly read
its ID and VERSION_ID fields to decide what to do on a given system.
| |
| Documentation
| |
For the full list of options, read man uname on the VPS, or the
uname(1)
manual page online at www.gsp.com/support/man/.
On FreeBSD see also freebsd-version(1); on Rocky Linux, os-release(5). For more commands
like this one, see The Unix Commands.
|
Toll Free 1-866-GSP-4400 • 1-301-464-9363 • service@gsp.com
Copyright © 1994-2026 GSP Services, Inc.
|