I'm building some code on java to disconnect the wifi in case theres an active wifi connection

To disconnect the wifi connection i use:

 nmcli con down id [SSID NAME]

But i need the command to check if theres an active connection an if so, i need the name of the SSID Active wifi connection

1 Answer 1


You can see the active connections with this command

nmcli con show --active

It will show you if there's an active wifi or ethernet connection, if there's no wifi type displayed then there's no active wifi connection.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .