tldr/pages.zh/osx/networksetup.md

20 lines
528 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.

# networksetup
> 网络系统首选项配置工具。
- 列出可用的网络服务源以太网、Wi-Fi、蓝牙等
`networksetup -listallnetworkservices`
- 显示特定网络设备的配置信息:
`networksetup -getinfo "{{Wi-Fi}}"`
- 获取当前连接的 Wi-Fi 网络名称Wi-Fi 设备通常为 en0 或 en1
`networksetup -getairportnetwork {{en0}}`
- 连接到给定的 Wi-Fi 网络 Connect to a particular Wi-Fi network:
`networksetup -setairportnetwork {{en0}} "{{无线网 SSID}}" {{密码}}`