tldr/pages.zh/osx/sysctl.md

25 lines
491 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# sysctl
> 访问内核状态信息。
> 更多信息:<https://keith.github.io/xcode-man-pages/sysctl.8.html>.
- 显示所有可用变量及其值:
`sysctl -a`
- 显示 Apple 型号标识符:
`sysctl -n hw.model`
- 显示 CPU 模型:
`sysctl -n machdep.cpu.brand_string`
- 显示可用的 CPU 功能MMX, SSE, SSE2, SSE3, AES, 等):
`sysctl -n machdep.cpu.features`
- 设置一个可更改的内核状态变量:
`sysctl -w {{部分。可修改的变量}}={{值}}`