[Mac OS X] 如何在终端查看 Mac OS 版本信息

news/2024/12/23 8:01:13/

本文转载至:https://www.cyberciti.biz/faq/mac-osx-find-tell-operating-system-version-from-bash-prompt/

use ssh client to login into my Mac Min server without GUI. How can I tell what version of Mac OS X operating system am I using command prompt? How do I find out Mac OS X version from Terminal app bash shell?


On Apple Mac OS X you need to use the following command to find out operating system version:

  1. system_profiler command – Show Apple hardware and software configuration.
  2. sw_vers command – Show Mac OS X operating system version.
  3. uname command – Show operating system name and more.

Determine OS X version from the command line

Open the terminal app and type the following command:
$ sw_vers
Sample outputs:

Fig. 01: Find OS X version from the command line

Fig. 01: Find OS X version from the command line


Where, you can pass the following options:

  1. -productName – Print just the value of the ProductName property.
  2. -productVersion – Print just the value of the ProductVersion property.
  3. -buildVersion – Print just the value of the BuildVersion property.

Say hello to system_profiler

You can use the system_profiler command as follows to get the same information:
$ system_profiler | less
$ system_profiler SPSoftwareDataType

Sample outputs:

Fig.02: Tell what version of OS X you are using on from the command line

Fig.02: Tell what version of OS X you are using on from the command line

Using SystemVersion.plist file

The above commands use /System/Library/CoreServices/SystemVersion.plist file. One can print the version info as follows:
$ cat /System/Library/CoreServices/SystemVersion.plist
Sample outputs:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict><key>ProductBuildVersion</key><string>15B42</string><key>ProductCopyright</key><string>1983-2015 Apple Inc.</string><key>ProductName</key><string>Mac OS X</string><key>ProductUserVisibleVersion</key><string>10.11.1</string><key>ProductVersion</key><string>10.11.1</string>
</dict>
</plist>

On Mac OS X server, try:
$ cat /System/Library/CoreServices/ServerVersion.plist

How do I find out OS X Darwin kernel version?

Simply type the following uname command to see operating system name including the machine hardware name, the nodename, the machine processor architecture name, the operating system release, the operating system name, and the operating system version:
$ uname -av
Sample outputs:

Darwin Viveks-MacBook-Pro.local 15.0.0 Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64

Tip: Read OS X version in audio format

Type the following bash command to hear OS X version using the say command on OS X:

say $(sw_vers) 
say $(sw_vers -productName && sw_vers -productVersion | sed 's/10//')


http://www.ppmy.cn/news/815581.html

相关文章

mac os的历史版本

本月苹果将发布OS X 10.8 Mountain Lion&#xff0c;是Mac OS X系统在其12年生命长河中的第9个版本。2001年&#xff0c;刚从鬼门关爬回来的苹果决定在OS X上做一个赌注&#xff0c;因为他们已经浪费了1984年原型Mac的“神奇魔力”。虽然从一开始便风波不断&#xff0c;但是OS …

Mac OS 如何升级到指定版本

个人2015年的mac book pro Mac os 10.13.3 安装应用各种限制&#xff0c;如docker找不到镜像&#xff0c;决心升级最新版本&#xff0c;我是没备份&#xff0c;升级的过程中千万别动等它自己结束&#xff0c;升级时间大约半个小时&#xff0c;升级后顿时心情舒畅。 mac os 路径…

CobaltStrike邮件钓鱼手法

CobaltStrike邮件钓鱼手法 一、CS&#xff08;cobaltstrike&#xff09;介绍1.1、Cobalt Strik是什么&#xff1f;1.2、cobaltstrike的安装与基础使用1.3、cs快捷工具栏 二、监听器Listener三、攻击Attacks四、攻击目标机器 - HTML Application五、控制目标主机六、生成后门木马…

XCode各版本与Mac OS各版本对应列表

Apple公司你不说牛B是不行的&#xff01;人家就是凭借“封闭”式开发与“封闭”式销售&#xff0c;硬是把手机移动市场的一大块牢牢把握住。我还不知道&#xff0c;目前世界上还有哪些IT公司敢向他们挑战。 不费话了&#xff0c;现在把XCode各版本与Mac OS各版本对应列表如下&a…

Mac OS中Git版本更新(亲测有效)

原本系统中装Git&#xff0c;但版本比较老&#xff0c;已经无法支持最新的IDEA 2022版本&#xff0c;那么如何将Git版本进行更新呢&#xff1f; 如果Git原来安装便是基于Homebrew&#xff0c;那么直接执行更新即可&#xff1a; brew upgrade git但如果去通过其他形式安装的&a…

如何使Mac版本的git升级至最新版

如何使Mac版本的git升级至最新版 使用brew命令安装最新版本的git&#xff08;2.37.3&#xff09;&#xff0c; brew install git 终端输入命令 git --version 发现系统仍然是旧的git版本&#xff0c;推测应该需要将最新版本的git地址加入到PATH中去 使用 echo $PATH 查看路…

Mac OS 每个版本的下载地址

macOS Sierra (10.12)下载地址 macOS High Sierra (10.13) 下载地址 macOS Mojave (10.14) 下载地址 macOS Catalina (10.15) 下载地址

分布式ELK日志文件分析系统(曾经沧海难为水,除却巫山不是云)

文章目录 一、ELK 概述1. 为什么要使用 ELK2. 完整日志系统基本特征3. ELK 简介3.1 ElasticSearch&#xff08;ES&#xff09;3.2 Kiabana3.3 Logstash3.4 其它组件Filebeat缓存/消息队列Fluentd 4. ELK 的工作原理5. Linux 系统内核日志消息的优先级别 二、 部署 ELK 集群服务…