10

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.

20

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
| improve this answer | |
  • nmcli con is equivalent to nmcli connection, which makes for more concise commands. – Matthias Braun Sep 19 at 10:47
  • @MatthiasBraun for even more brevity, nmcli c also works. I believe it is some form of auto completion. – Joann Morris Sep 23 at 1:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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