Yurij Asked: 2018-04-04 01:37:23 +0800 CST2018-04-04 01:37:23 +0800 CST 2018-04-04 01:37:23 +0800 CST Get a list of network manager network connections with Bash? 772 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. command-line bash network-manager nmcli 1 Answers Voted Best Answer Ravexina 2018-04-04T01:41:08+08:002018-04-04T01:41:08+08:00 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
All NetworkManager connections are located in:
/etc/NetworkManager/system-connections/
So you can easily use
ls
to get a list of them:then remove the one you want:
You can also use
nmcli
tool, which is a better idea:To get a list of connections:
To get informations about a connection:
You can pip it to
grep
to look for specific info:To modify a connection:
Example:
To delete a connection