11

I want to get a list of Ethernet and wireless connections from the terminal. Those connections are listed in NetworkManager's GUI and include info like the connection's SSID.

NetworkManager GUI with connections

The next step is to delete unwanted connections.

1 Answer 1

26

All NetworkManager connections are located in: /etc/NetworkManager/system-connections/

So you can easily use ls to get a list of them:

ls /etc/NetworkManager/system-connections/

then remove the one you want:

sudo rm /etc/NetworkManager/system-connections/some-connection

You can also use nmcli tool, which is a better idea:

To get a list of connections:

nmcli connection

To get informations about a connection:

nmcli connection show connection-name

You can pip it to grep to look for specific info:

nmcli connection show connection-name | grep ipv4.dns

To modify a connection:

nmcli connection modify connection-name config-name new-alue

Example:

nmcli connection modify HomeNetwork ipv4.dns 8.8.8.8

To delete a connection

nmcli connection delete connection-name
2
  • 2
    nmcli con is equivalent to nmcli connection, which makes for more concise commands. Sep 19, 2020 at 10:47
  • @MatthiasBraun for even more brevity, nmcli c also works. I believe it is some form of auto completion. Sep 23, 2020 at 1:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.