Tutorial: How to Get the Linux Version From The Command Line
Last Update: Mar 25, 2023

AI changed software development. This is how the pros use it.
Written for working developers, Coding with AI goes beyond hype to show how AI fits into real production workflows. Learn how to integrate AI into Python projects, avoid hallucinations, refactor safely, generate tests and docs, and reclaim hours of development time—using techniques tested in real-world projects.
There are several ways to get your Linux version from the command line. One way that just displays a basic name:
uname
But this usually just returns “Linux”. Pretty sure you already knew that. A more detailed view would be:
uname -a
Which shows “all” the information uname provides.
Here are some other switches for uname:
-a, --all print all information, in the following order,
except omit -p and -i if unknown:
-s, --kernel-name print the kernel name
-n, --nodename print the network node hostname
-r, --kernel-release print the kernel release
-v, --kernel-version print the kernel version
-m, --machine print the machine hardware name
-p, --processor print the processor type or "unknown"
-i, --hardware-platform print the hardware platform or "unknown"
-o, --operating-system print the operating system
--help display this help and exit
--version output version information and exit
There is another method for gathering system information:
cat /proc/version
This will also show you quite a bit of information on your system.
Linux version 2.6.32-71.el6.x86_64 (mockbuild@x86-007.build.bos.redhat.com) (gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) ) #1 SMP Wed Sep 1 01:33:01 EDT 2010
Some distros have their own methods of identification also, such as RedHat:
cat /etc/redhat-release
Consult your manuals for each distro to find out where they store this information.

Want to learn more about Linux? Of course you do. Check out this Linux Fundamentals course. You can sign up for a free trial here and take it today!

Skip the hype. The newsletter that keeps you in the know.
AI news curated for engineers. The AI New Hotness Newsletter is what you need.
Zero fluff. Just the research, tools, and infra updates that actually affect your production stack.
Stay up to date on AI for developers - Subscribe on LinkedIn





