Delete many network configurations at once Opening my Network preferences screen in Mojave 10.14.2 on my MacBook Pro 2017 takes about two minutes, due to the massive number of network configurations that were automatically installed when I once attached a USB walkie talkie.

Is it possible to delete all these connections at once? Clicking to delete them one by one is incredibly slow due to the UI hanging after removing one.


Network preferences with literally 1000 network connections
You can use the Terminal to delete them out:

Usage: networksetup -removenetworkservice &lt;networkservice&gt;
    Remove the service named &lt;networkservice&gt;. Will fail if this is the only service on the hardware port that &lt;networkservice&gt; is on.


To get it to list then remove all the ones with MT65XX you'd need to do something like:

$ services=("${(@f)$(networksetup -listallnetworkservices | grep MT65XX | sed s/\*//)}")
$ for service in $services[@]; do networksetup -removenetworkservice $service; done


That this does is builds a list of services by running:

networksetup -listallnetworkservices | grep MT65XX | sed s/\*//


The @f splits the list on newlines, ignoring spaces. The grep finds just the MT65XX lines, and the sed removes any *, which denote disabled services in the output.

Then, for each of those, it runs the networksetup -removenetworkservice step.