{"id":13641,"date":"2024-10-11T12:34:34","date_gmt":"2024-10-11T12:34:34","guid":{"rendered":"https:\/\/www.bodhost.com\/kb\/?p=13641"},"modified":"2026-06-16T06:44:09","modified_gmt":"2026-06-16T06:44:09","slug":"how-to-determine-os-versions-using-the-command-line","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/","title":{"rendered":"How to Determine OS Versions Using the Command Line"},"content":{"rendered":"<p>Knowing your system&#8217;s OS version is vital for troubleshooting issues, seeking software support, and ensuring software compatibility. This guide covers every major platform: Windows, Linux (all major distros), macOS, and Unix, using command-line tools that give you instant, accurate results without opening a single settings menu.<\/p>\n<h3><strong>Quick Reference: All Commands at a Glance<\/strong><\/h3>\n<p>Use the table below to instantly find the right command for your platform.<\/p>\n<table>\n<thead>\n<tr>\n<th><span style=\"color: #000000;\">Platform<\/span><\/th>\n<th><span style=\"color: #000000;\">Command<\/span><\/th>\n<th><span style=\"color: #000000;\">Output<\/span><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Windows CMD<\/td>\n<td><code>ver<\/code><\/td>\n<td>Windows version<\/td>\n<\/tr>\n<tr>\n<td>Windows CMD<\/td>\n<td><code>winver<\/code><\/td>\n<td>Version &amp; build dialog<\/td>\n<\/tr>\n<tr>\n<td>Windows CMD<\/td>\n<td><code>systeminfo | findstr \/B \/C:\"OS\"<\/code><\/td>\n<td>OS details<\/td>\n<\/tr>\n<tr>\n<td>Windows CMD<\/td>\n<td><code>wmic os get Caption,Version,BuildNumber<\/code><\/td>\n<td>OS + version + build<\/td>\n<\/tr>\n<tr>\n<td>PowerShell<\/td>\n<td><code>[System.Environment]::OSVersion<\/code><\/td>\n<td>Full OS version<\/td>\n<\/tr>\n<tr>\n<td>Linux<\/td>\n<td><code>uname -a<\/code><\/td>\n<td>Kernel + architecture<\/td>\n<\/tr>\n<tr>\n<td>Linux<\/td>\n<td><code>cat \/etc\/os-release<\/code><\/td>\n<td>Distro + version<\/td>\n<\/tr>\n<tr>\n<td>Linux<\/td>\n<td><code>lsb_release -a<\/code><\/td>\n<td>Release details<\/td>\n<\/tr>\n<tr>\n<td>Ubuntu<\/td>\n<td><code>lsb_release -d<\/code><\/td>\n<td>Ubuntu version<\/td>\n<\/tr>\n<tr>\n<td>Debian<\/td>\n<td><code>cat \/etc\/debian_version<\/code><\/td>\n<td>Debian version<\/td>\n<\/tr>\n<tr>\n<td>CentOS\/RHEL<\/td>\n<td><code>cat \/etc\/redhat-release<\/code><\/td>\n<td>RHEL\/CentOS version<\/td>\n<\/tr>\n<tr>\n<td>Fedora<\/td>\n<td><code>cat \/etc\/fedora-release<\/code><\/td>\n<td>Fedora version<\/td>\n<\/tr>\n<tr>\n<td>Kali<\/td>\n<td><code>cat \/etc\/os-release | grep VERSION<\/code><\/td>\n<td>Kali version<\/td>\n<\/tr>\n<tr>\n<td>WSL<\/td>\n<td><code>wsl --version<\/code><\/td>\n<td>WSL + kernel<\/td>\n<\/tr>\n<tr>\n<td>macOS<\/td>\n<td><code>sw_vers<\/code><\/td>\n<td>macOS version<\/td>\n<\/tr>\n<tr>\n<td>macOS<\/td>\n<td><code>sw_vers -productVersion<\/code><\/td>\n<td>Version only<\/td>\n<\/tr>\n<tr>\n<td>Unix\/AIX<\/td>\n<td><code>uname -a<\/code><\/td>\n<td>Kernel + OS details<\/td>\n<\/tr>\n<tr>\n<td>Unix\/AIX<\/td>\n<td><code>oslevel<\/code><\/td>\n<td>AIX version<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><strong>Checking OS Version on Windows (CMD &amp; PowerShell)<\/strong><\/h3>\n<p>Windows provides several <a href=\"https:\/\/www.bodhost.com\/kb\/how-to-unzip-files-via-command-prompt\/\" target=\"_blank\" rel=\"noopener\">command-line methods<\/a> to check your OS version. Here are the most reliable ones, from quickest to most detailed.<\/p>\n<h5><strong>1. Using the ver Command (Quickest)<\/strong><\/h5>\n<p>Windows: The ver command is the simplest way to display the Windows OS version and copyright information. It works on all Windows versions from XP through Windows 11 and runs without administrator privileges.<\/p>\n<p><code>ver<\/code><\/p>\n<p><strong>Example output:<\/strong><\/p>\n<p><code>Microsoft Windows [Version 10.0.22621.3593]<\/code><\/p>\n<p>The number breakdown: 10.0 = Windows 10 \/ 11 base, 22621 = build number (22H2 in this case), 3593 = update revision.<\/p>\n<h5><strong>2. Using winver<\/strong><\/h5>\n<p>Windows The winver command launches a small dialog box that shows your Windows edition, version, build number, and registered user, more human-readable than ver.<\/p>\n<p><code>winver<\/code><\/p>\n<p>This opens the About Windows dialog. It tells you the Windows edition (e.g., Windows 11 Home), version (e.g., 23H2), and OS build number all on one screen. You can run it from the Run dialog (Win+R) or any command prompt.<\/p>\n<h5><strong>3. Using systeminfo<\/strong><\/h5>\n<p>Windows The <span style=\"text-decoration: underline;\">systeminfo<\/span> command provides comprehensive system information, including OS version, build, install date, processor, RAM, and more. It is ideal when you need full system details.<\/p>\n<p><code>systeminfo<\/code><\/p>\n<p><strong>To filter just the OS-related lines:<\/strong><\/p>\n<p><code>systeminfo | findstr \/B \/C:\"OS Name\" \/C:\"OS Version\" \/C:\"OS Build Type\"<\/code><\/p>\n<p><strong>Example output:<\/strong><\/p>\n<p><code>OS Name:                   Microsoft Windows 11 Pro<br \/>\nOS Version:                10.0.22621 N\/A Build 22621<br \/>\nOS Build Type:             Multiprocessor Free<\/code><\/p>\n<h5><strong>4. Using wmic for Scripting<\/strong><\/h5>\n<p>Windows The Windows Management Instrumentation Command-line (<span style=\"text-decoration: underline;\">wmic<\/span>) lets you query OS information in a format that is easy to parse in scripts.<\/p>\n<p><code>wmic os get Caption,Version,BuildNumber<\/code><\/p>\n<p><strong>Example output:<\/strong><\/p>\n<p><code>BuildNumber  Caption                              Version<br \/>\n22621        Microsoft Windows 11 Pro             10.0.22621<\/code><\/p>\n<p><strong>To get the OS architecture:<\/strong><\/p>\n<p><code>wmic os get osarchitecture<\/code><\/p>\n<p><strong>To get the product name and version together:<\/strong><\/p>\n<p><code>wmic os get name,version<\/code><\/p>\n<h5><strong>5. Using PowerShell<\/strong><\/h5>\n<p>Windows PowerShell provides rich OS version information through .NET and WMI objects.<\/p>\n<p><strong>Get full OS version object:<\/strong><\/p>\n<p><code>[System.Environment]::OSVersion<\/code><\/p>\n<p><strong>Get just the version string:<\/strong><\/p>\n<p><code>[System.Environment]::OSVersion.VersionString<\/code><\/p>\n<p><strong>Get OS name and version via CIM (recommended for Windows 10+):<\/strong><\/p>\n<p><code>(Get-CimInstance Win32_OperatingSystem).Caption<br \/>\n(Get-CimInstance Win32_OperatingSystem).Version<\/code><\/p>\n<p><strong>Check Windows Server version from the command line:<\/strong><\/p>\n<p><code>Get-ComputerInfo | Select-Object OsName, OsVersion, WindowsVersion<\/code><\/p>\n<p><strong>Example output:<\/strong><\/p>\n<p><code>OsName          : Microsoft Windows 11 Pro<br \/>\nOsVersion       : 10.0.22621<br \/>\nWindowsVersion  : 2009<\/code><\/p>\n<h3><strong>Checking OS Version on Linux<\/strong><\/h3>\n<div class=\"callout warn\">Linux has multiple reliable methods to check your distribution and version. The right command depends on whether you need the kernel version or the distribution version; they are different.<\/div>\n<div><\/div>\n<div>\n<table class=\"compare-table\">\n<thead>\n<tr>\n<th><span style=\"color: #000000;\">What You Want<\/span><\/th>\n<th><span style=\"color: #000000;\">Command<\/span><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Kernel version (same on all distros)<\/td>\n<td><code>uname -r<\/code><\/td>\n<\/tr>\n<tr>\n<td>Distribution name + version<\/td>\n<td><code>cat \/etc\/os-release<\/code><\/td>\n<\/tr>\n<tr>\n<td>Distribution info (human-readable)<\/td>\n<td><code>lsb_release -a<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5><strong>1. Using uname \u2014 Kernel Version<\/strong><\/h5>\n<p>Linux uname is available on every Linux and Unix system. It reports kernel-level information.<\/p>\n<\/div>\n<pre><code><span style=\"color: #3366ff;\"># Full info: kernel name, hostname, kernel release, version, machine, OS\r\nuname -a\r\n# Just the kernel version number\r\nuname -r\r\n# Just the OS\/kernel name\r\nuname -s\r\n# Machine hardware (x86_64, aarch64, etc.)\r\nuname -m<\/span><\/code><\/pre>\n<p><strong>Example output of uname -a:<\/strong><\/p>\n<p><code>Linux myserver 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 19 02:08:17 UTC 2024 x86_64 x86_64 x86_64 GNU\/Linux<\/code><\/p>\n<div class=\"callout\">\n<h5><strong>2. Reading \/etc\/os-release \u2014 Universal Method<\/strong><\/h5>\n<p>Linux: The <span style=\"text-decoration: underline;\">\/etc\/os-release<\/span> file is the most reliable, cross-distro method. It exists on virtually all modern Linux distributions.<\/p>\n<\/div>\n<pre><code><span style=\"color: #3366ff;\"># Show all contents\r\ncat \/etc\/os-release\r\n# Show only the pretty name (e.g., \"Ubuntu 22.04.4 LTS\")\r\ngrep PRETTY_NAME \/etc\/os-release\r\n# Show just the version number\r\ngrep VERSION_ID \/etc\/os-release<\/span><\/code><\/pre>\n<p><strong>Example output:<\/strong><\/p>\n<pre><code><span style=\"color: #3366ff;\">NAME=\"Ubuntu\"\r\nVERSION=\"22.04.4 LTS (Jammy Jellyfish)\"\r\nID=ubuntu\r\nID_LIKE=debian\r\nPRETTY_NAME=\"Ubuntu 22.04.4 LTS\"\r\nVERSION_ID=\"22.04\"\r\nHOME_URL=\"https:\/\/www.ubuntu.com\/\"<\/span><\/code><\/pre>\n<h5><strong>3. Using lsb_release<\/strong><\/h5>\n<p>Linux <span style=\"text-decoration: underline;\">lsb_release<\/span> prints Linux Standard Base (LSB) information about the distribution. It is available on Debian, Ubuntu, and most derivatives. On minimal installs, you may need to install it first.<\/p>\n<pre><code><span style=\"color: #3366ff;\"># Show all LSB info\r\nlsb_release -a\r\n# Show only the description line\r\nlsb_release -d\r\n# Show only the release number\r\nlsb_release -r\r\n# Show codename only\r\nlsb_release -c<\/span><\/code><\/pre>\n<p><strong>Example output of lsb_release -a:<\/strong><\/p>\n<pre><span style=\"color: #3366ff;\"><code>No LSB modules are available.\r\nDistributor ID: Ubuntu\r\nDescription:    Ubuntu 22.04.4 LTS\r\nRelease:        22.04\r\nCodename:       jammy<\/code><\/span><\/pre>\n<p><strong>Install if missing:<\/strong><\/p>\n<pre><code><span style=\"color: #3366ff;\"># Debian\/Ubuntu\r\nsudo apt install lsb-release\r\n# CentOS\/RHEL\r\nsudo yum install redhat-lsb-core<\/span><\/code><\/pre>\n<h5><strong>4. Checking Ubuntu Version<\/strong><\/h5>\n<p>Ubuntu uses both <span style=\"text-decoration: underline;\">lsb_release<\/span> and its own release file.<\/p>\n<pre><code><span style=\"color: #3366ff;\"># Best method \u2014 shows full Ubuntu version\r\nlsb_release -a\r\n# Quick check \u2014 just the version number\r\nlsb_release -d\r\n# Alternative \u2014 from the release file\r\ncat \/etc\/ubuntu-release 2&gt;\/dev\/null || cat \/etc\/os-release\r\n# Check via the update manager file\r\ncat \/etc\/lsb-release<\/span><\/code><\/pre>\n<p><strong>Example output:<\/strong><\/p>\n<p><code>Description:    Ubuntu 22.04.4 LTS<\/code><\/p>\n<h5><strong>5. Checking Debian Version<\/strong><\/h5>\n<p>Debian maintains its own version file alongside the standard <span style=\"text-decoration: underline;\">\/etc\/os-release<\/span>.<\/p>\n<pre><code><span style=\"color: #3366ff;\"># Debian-specific version file\r\ncat \/etc\/debian_version\r\n# Full info via os-release\r\ncat \/etc\/os-release\r\n# Check distribution version via lsb_release\r\nlsb_release -a<\/span><\/code><\/pre>\n<p><strong>Example output of cat \/etc\/debian_version:<\/strong><\/p>\n<p><code>12.5<\/code><\/p>\n<h5><strong>6. Checking CentOS and RHEL Version<\/strong><\/h5>\n<p>CentOS, RHEL, and Red Hat-based systems use a dedicated release file.<\/p>\n<pre><code><span style=\"color: #3366ff;\"># CentOS\/RHEL release file\r\ncat \/etc\/redhat-release\r\n# Rocky Linux \/ AlmaLinux (RHEL-compatible)\r\ncat \/etc\/rocky-release\r\ncat \/etc\/almalinux-release\r\n# Universal method\r\ncat \/etc\/os-release\r\n# Using rpm to check release version\r\nrpm -q centos-release\r\nrpm -q redhat-release-server<\/span><\/code><\/pre>\n<p><strong>Example output:<\/strong><\/p>\n<pre><code><span style=\"color: #3366ff;\"># CentOS\r\nCentOS Linux release 7.9.2009 (Core)\r\n# RHEL\r\nRed Hat Enterprise Linux release 9.3 (Plow)<\/span><\/code><\/pre>\n<p>To check the RHEL version from the command line with a single command:<\/p>\n<p><code>cat \/etc\/os-release | grep \"PRETTY_NAME\"<\/code><\/p>\n<h5><strong>7. Checking Fedora Version<\/strong><\/h5>\n<pre><code><span style=\"color: #3366ff;\"># Fedora-specific release file\r\ncat \/etc\/fedora-release\r\n# Universal method\r\ncat \/etc\/os-release\r\n# via rpm\r\nrpm -E %fedora<\/span><\/code><\/pre>\n<p><strong>Example output:<\/strong><\/p>\n<p><code>Fedora release 40 (Forty)<\/code><\/p>\n<h5><strong>8. Checking Kali Linux Version<\/strong><\/h5>\n<p>Kali Linux is a rolling-release distribution. Version information is in the standard files.<\/p>\n<pre><code><span style=\"color: #3366ff;\"># Show Kali version\r\ncat \/etc\/os-release | grep VERSION\r\n# Full details\r\ncat \/etc\/os-release\r\n# Kali-specific\r\ncat \/etc\/kali-release 2&gt;\/dev\/null || lsb_release -a<\/span><\/code><\/pre>\n<p><strong>Example output:<\/strong><\/p>\n<p><code>VERSION=\"2024.1\"<br \/>\nVERSION_ID=\"2024.1\"<br \/>\nVERSION_CODENAME=\"kali-rolling\"<\/code><\/p>\n<h3><strong>Checking OS Version on macOS<\/strong><\/h3>\n<p>macOS provides the <span style=\"text-decoration: underline;\">sw_vers<\/span> command for clean, scriptable version output.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-15379 aligncenter\" src=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/macos.png\" alt=\"macos\" width=\"498\" height=\"227\" srcset=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/macos.png 498w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/macos-300x137.png 300w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/p>\n<p><strong>Example output of sw_vers:<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-15380\" src=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/sw-vers.png\" alt=\"sw vers\" width=\"448\" height=\"78\" srcset=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/sw-vers.png 448w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/sw-vers-300x52.png 300w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/p>\n<p>You can also use the <span style=\"text-decoration: underline;\">system_profiler<\/span> command for detailed information:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-15381\" src=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/system-profile.png\" alt=\"system profile\" width=\"444\" height=\"40\" srcset=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/system-profile.png 444w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/system-profile-300x27.png 300w\" sizes=\"auto, (max-width: 444px) 100vw, 444px\" \/><\/p>\n<p><strong>Or via the terminal with uname:<\/strong><\/p>\n<pre><span style=\"color: #3366ff;\"><code>uname -a\r\n# Darwin MacBook.local 23.5.0 Darwin Kernel Version 23.5.0 ... x86_64<\/code><\/span><\/pre>\n<h3><strong>Checking OS Version on Unix (AIX, Solaris)<\/strong><\/h3>\n<p>Traditional Unix systems use uname plus platform-specific commands.<\/p>\n<p><strong>General Unix (any system):<\/strong><\/p>\n<pre><span style=\"color: #3366ff;\"><code>uname -a\r\nuname -r   # kernel release\r\nuname -s   # OS name\r\nuname -v   # OS version<\/code><\/span><\/pre>\n<h5><strong>AIX:<\/strong><\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15384 size-medium\" src=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/AIX-300x68.png\" alt=\"AIX\" width=\"300\" height=\"68\" srcset=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/AIX-300x68.png 300w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/AIX.png 519w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h5><strong>Solaris \/ Oracle Solaris:<\/strong><\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15385 size-medium\" src=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/Solarise-300x36.png\" alt=\"Solaris \" width=\"300\" height=\"36\" srcset=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/Solarise-300x36.png 300w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/Solarise.png 460w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<h5><strong>Example AIX output:<\/strong><\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-15386\" src=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/AIX-Output.png\" alt=\"AIX Output\" width=\"266\" height=\"57\" \/><\/p>\n<h4><strong>Working with a VPS or Dedicated Server?<\/strong><\/h4>\n<p>If you are managing a\u00a0<a href=\"https:\/\/www.bodhost.com\/web-servers\/linux-vps-hosting\">Linux VPS<\/a>\u00a0or\u00a0<a href=\"https:\/\/www.bodhost.com\/web-servers\/dedicated-servers\">Dedicated Server<\/a>, checking your OS version is often the first step when troubleshooting compatibility issues, applying security patches, or installing software. The commands on this page work for any Linux VPS regardless of the control panel.<\/p>\n<h4>Related Articles<\/h4>\n<ul>\n<li><a href=\"https:\/\/www.bodhost.com\/kb\/how-to-remove-multiple-files-using-command-line\/\">How to Remove Multiple Files Using the Command Line<\/a><\/li>\n<li><a href=\"https:\/\/www.bodhost.com\/kb\/how-to-manage-nginx-with-start-stop-and-restart\/\">How to Manage Nginx with Start, Stop, and Restart<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Knowing your system&#8217;s OS version is vital for troubleshooting issues, seeking software support, and ensuring software compatibility. This guide covers every major platform: Windows, Linux (all major distros), macOS, and Unix, using command-line tools that give you instant, accurate results without opening a single settings menu. Quick Reference: All Commands at a Glance Use the [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[837],"tags":[1577],"class_list":["post-13641","post","type-post","status-publish","format-standard","hentry","category-tutorial","tag-determine-os-versions-using-the-command-line"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Determine OS Versions Using the Command Line<\/title>\n<meta name=\"description\" content=\"In this article, you will explore how to determine OS versions on Windows and Linux using the Command Line.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Determine OS Versions Using the Command Line\" \/>\n<meta property=\"og:description\" content=\"In this article, you will explore how to determine OS versions on Windows and Linux using the Command Line.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-11T12:34:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-16T06:44:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/macos.png\" \/>\n\t<meta property=\"og:image:width\" content=\"498\" \/>\n\t<meta property=\"og:image:height\" content=\"227\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Serena\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Serena\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-determine-os-versions-using-the-command-line\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-determine-os-versions-using-the-command-line\\\/\"},\"author\":{\"name\":\"Serena\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/ffd3f118493c99471ae5bd4790a55830\"},\"headline\":\"How to Determine OS Versions Using the Command Line\",\"datePublished\":\"2024-10-11T12:34:34+00:00\",\"dateModified\":\"2026-06-16T06:44:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-determine-os-versions-using-the-command-line\\\/\"},\"wordCount\":785,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-determine-os-versions-using-the-command-line\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/macos.png\",\"keywords\":[\"Determine OS Versions Using the Command Line\"],\"articleSection\":[\"Tutorial\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-determine-os-versions-using-the-command-line\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-determine-os-versions-using-the-command-line\\\/\",\"name\":\"How to Determine OS Versions Using the Command Line\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-determine-os-versions-using-the-command-line\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-determine-os-versions-using-the-command-line\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/macos.png\",\"datePublished\":\"2024-10-11T12:34:34+00:00\",\"dateModified\":\"2026-06-16T06:44:09+00:00\",\"description\":\"In this article, you will explore how to determine OS versions on Windows and Linux using the Command Line.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-determine-os-versions-using-the-command-line\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-determine-os-versions-using-the-command-line\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-determine-os-versions-using-the-command-line\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/macos.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/macos.png\",\"width\":498,\"height\":227,\"caption\":\"macos\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-determine-os-versions-using-the-command-line\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Tutorial\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Determine OS Versions Using the Command Line\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/ffd3f118493c99471ae5bd4790a55830\",\"name\":\"Serena\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g\",\"caption\":\"Serena\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/seema\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Determine OS Versions Using the Command Line","description":"In this article, you will explore how to determine OS versions on Windows and Linux using the Command Line.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/","og_locale":"en_US","og_type":"article","og_title":"How to Determine OS Versions Using the Command Line","og_description":"In this article, you will explore how to determine OS versions on Windows and Linux using the Command Line.","og_url":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2024-10-11T12:34:34+00:00","article_modified_time":"2026-06-16T06:44:09+00:00","og_image":[{"width":498,"height":227,"url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/macos.png","type":"image\/png"}],"author":"Serena","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Serena","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/"},"author":{"name":"Serena","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/ffd3f118493c99471ae5bd4790a55830"},"headline":"How to Determine OS Versions Using the Command Line","datePublished":"2024-10-11T12:34:34+00:00","dateModified":"2026-06-16T06:44:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/"},"wordCount":785,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/macos.png","keywords":["Determine OS Versions Using the Command Line"],"articleSection":["Tutorial"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/","url":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/","name":"How to Determine OS Versions Using the Command Line","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/#primaryimage"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/macos.png","datePublished":"2024-10-11T12:34:34+00:00","dateModified":"2026-06-16T06:44:09+00:00","description":"In this article, you will explore how to determine OS versions on Windows and Linux using the Command Line.","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/#primaryimage","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/macos.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2024\/10\/macos.png","width":498,"height":227,"caption":"macos"},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/how-to-determine-os-versions-using-the-command-line\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Tutorial","item":"https:\/\/www.bodhost.com\/kb\/category\/tutorial\/"},{"@type":"ListItem","position":2,"name":"How to Determine OS Versions Using the Command Line"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/ffd3f118493c99471ae5bd4790a55830","name":"Serena","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g","caption":"Serena"},"url":"https:\/\/www.bodhost.com\/kb\/author\/seema\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/13641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=13641"}],"version-history":[{"count":6,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/13641\/revisions"}],"predecessor-version":[{"id":13646,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/13641\/revisions\/13646"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=13641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=13641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=13641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}