macos 用于确定规格的终端命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11274279/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Terminal command for determining specs
提问by Katana24
I realise that you can easily determine a macs specs by examining the 'About this Mac' function on the desktop. But I would like to do it through the terminal if it's possible to. So how do you go about doing it? If there are any comprehensive resources you can recommend point me to em!
我意识到您可以通过检查桌面上的“关于此 Mac”功能轻松确定 mac 规格。但如果可能的话,我想通过终端来完成。那么你打算怎么做呢?如果有什么综合资源可以推荐点我去em!
Cheers
干杯
回答by Anne
You're looking for is the system_profiler
command.
你要找的是system_profiler
命令。
Create plist
containing system information for all SPDataTypes
:
plist
为所有创建包含系统信息SPDataTypes
:
system_profiler -xml
Create plist
containing information for specific SPDataType
:
创建plist
包含特定信息的信息SPDataType
:
system_profiler -xml SPHardwareRAIDDataType
List of SPDataTypes
:
名单SPDataTypes
:
SPParallelATADataType
SPApplicationsDataType
SPAudioDataType
SPBluetoothDataType
SPCardReaderDataType
SPComponentDataType
SPDeveloperToolsDataType
SPDiagnosticsDataType
SPDiscBurningDataType
SPEthernetDataType
SPExtensionsDataType
SPFibreChannelDataType
SPFireWireDataType
SPFirewallDataType
SPFontsDataType
SPFrameworksDataType
SPDisplaysDataType
SPHardwareDataType
SPHardwareRAIDDataType
SPNetworkLocationDataType
SPLogsDataType
SPManagedClientDataType
SPMemoryDataType
SPModemDataType
SPNetworkDataType
SPPCIDataType
SPParallelSCSIDataType
SPPowerDataType
SPPrefPaneDataType
SPPrintersSoftwareDataType
SPPrintersDataType
SPConfigurationProfileDataType
SPSASDataType
SPSerialATADataType
SPSoftwareDataType
SPStartupItemDataType
SPSyncServicesDataType
SPThunderboltDataType
SPUSBDataType
SPUniversalAccessDataType
SPNetworkVolumeDataType
SPWWANDataType
SPAirPortDataType
For further details how to use system_profiler
run:
有关如何使用system_profiler
run 的更多详细信息:
man system_profiler
回答by User5910
As @Anne posted, system_profiler
is useful, but if you need more details, such as CPU model number, family, stepping, features (ex. SSSE3), try
正如@Anne 发布的那样,system_profiler
很有用,但如果您需要更多详细信息,例如 CPU 型号、系列、步进、功能(例如 SSSE3),请尝试
sysctl
Each line of output contains the full hierarchy of categories so you can grep down the results to what you're looking for, ex. to see CPU details:
每行输出都包含类别的完整层次结构,因此您可以将结果搜索到您要查找的内容,例如。查看 CPU 详细信息:
sysctl | grep machdep.cpu
View the man pageonline or in the terminal:
在线或在终端中查看手册页:
man sysctl