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.
The next step is to delete unwanted connections.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityAll 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
nmcli con
is equivalent to nmcli connection
, which makes for more concise commands.
Sep 19, 2020 at 10:47
nmcli c
also works. I believe it is some form of auto completion.
Sep 23, 2020 at 1:34