Linux command line to turn off wireless WiFi

1. rfkill command

  rfkillThe command comes from the abbreviation of the English phrase “radio frequency kill”whose function is to manage Bluetooth and devices in the system WiFi. rfkillThe command is a kernel-level management tool that turns Bluetooth and features on or off in the system WiFi.

usage

rfkill [参数] 设备名

Optional parameters

parameter Function
block Turn off the device
list List available devices
unblock Turn on the device
–version Print version information

Usage example:
List all WiFiBluetooth devices in the current system.

[root@Linux-IM ~]# rfkill list
0: hci0: Bluetooth
        Soft blocked: yes
        Hard blocked: no
1: phy0: Wireless LAN
        Soft blocked: yes
        Hard blocked: no

Close the specified numbered device.

[root@Linux-IM~]# rfkill block 1

[注]:这样就可以关闭无线设备了。

2.nmcli command

  In fact, nmcliall network devices can be managed, here is just how to use it to turn off or turn on the wireless network.

Turn off wireless network command

[root@Linux-IM~]# nmcli radio wifi off

Or abbreviated as follows

[root@Linux-IM~]# nmcli r wifi off

Enable wireless network command

[root@Linux-IM~]# nmcli radio wifi on

Or abbreviated as follows

[root@Linux-IM~]# nmcli r wifi on

Disable all networks

[root@Linux-IM~]# nmcli networking off

Guess you like

Origin blog.csdn.net/qq_36393978/article/details/131783521