Mac查看CPU具体型号
查看 CPU 型号
sysctl machdep.cpu.brand_string
查看系统相关信息
➜ system_profiler -listDataTypes
Available Datatypes:
SPParallelATADataType
SPUniversalAccessDataType
SPSecureElementDataType
SPApplicationsDataType
SPAudioDataType
SPBluetoothDataType
SPCameraDataType
SPCardReaderDataType
SPComponentDataType
SPiBridgeDataType
SPDeveloperToolsDataType
SPDiagnosticsDataType
SPDisabledSoftwareDataType
SPDiscBurningDataType
SPEthernetDataType
SPExtensionsDataType
SPFibreChannelDataType
SPFireWireDataType
SPFirewallDataType
SPFontsDataType
SPFrameworksDataType
SPDisplaysDataType
SPHardwareDataType
SPHardwareRAIDDataType
SPInstallHistoryDataType
SPLegacySoftwareDataType
SPNetworkLocationDataType
SPLogsDataType
SPManagedClientDataType
SPMemoryDataType
SPNVMeDataType
SPNetworkDataType
SPPCIDataType
SPParallelSCSIDataType
SPPowerDataType
SPPrefPaneDataType
SPPrintersSoftwareDataType
SPPrintersDataType
SPConfigurationProfileDataType
SPRawCameraDataType
SPSASDataType
SPSerialATADataType
SPSPIDataType
SPSmartCardsDataType
SPSoftwareDataType
SPStartupItemDataType
SPStorageDataType
SPSyncServicesDataType
SPThunderboltDataType
SPUSBDataType
SPNetworkVolumeDataType
SPWWANDataType
SPAirPortDataType
查看对应信息,比如查看硬件概述
➜ system_profiler SPHardwareDataType
Hardware:
Hardware Overview:
Model Name: MacBook Air
Model Identifier: MacBookAir7,2
Processor Name: Intel Core i7
Processor Speed: 2.2 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache (per Core): 256 KB
L3 Cache: 4 MB
Memory: 8 GB
Boot ROM Version: 184.0.0.0.0
SMC Version (system): 2.27f2
Serial Number (system): FVFW5047J1WV
Hardware UUID: 61763F2C-47F2-580E-9E02-409384172D75
查看有线网络信息
➜ system_profiler SPEthernetDataType
Ethernet Cards:
USB 10/100 LAN:
Type: USB
BSD name: en3
Kext name: AppleUSBECM.kext
Location: /System/Library/Extensions/AppleUSBECM.kext
Version: 5.0.0
MAC Address: 9c:eb:e8:b0:a6:ff
Product ID: 17
Vendor ID: 10007
USB:
Type: USB
BSD name: en4
Kext name: AppleUSBNCM.kext
Location: /System/Library/Extensions/AppleUSBNCM.kext
Version: 5.0.0
MAC Address: de:56:e7:af:d6:89
Product ID: 4776
Vendor ID: 1452
查看应用信息
system_profiler SPApplicationsDataType
生成 XML 报告
➜ system_profiler -xml SPEthernetDataType SPFirewallDataType > ~/Desktop/system_profile-EthernetFirewall.xml
更多使用查看帮助
➜ system_profiler -h
OC用AFN做Soap请求webService
OC 千位分隔符格式化数字
工作中总是碰到很多需求,比如金额需要以千位分隔的方式显示,这是OC版本转换方法,其它语言的可参考,代码如下:
Ubuntu 查看分区内文件及文件夹占用大小
Ubuntu 开启 ssh 登录
电脑多了,总是需要切来切去,工作或者在家里都不止一台电脑,jenkins 构建机、网盘机等,linux 服务机我这用的基本都是 Ubuntu,记录下 Ubuntu 开启 ssh 登录。