After 4 years of running a pretty stable linux on my notebook I realized that the time had come that too much software and dependencies have been on my system so I set up a clean system. By doing so I also switched to a tiling window manager called awesome (with which I am pretty happy so far). One problem (not really since it is the purpose of going to awesome) though is that everything has to be done from the command line. in particular when I join a network I have to use the network manager command line interface nmcli to set up my wireless connection or my wired connection. That is not too much of a problem but since I did a backup of all my old network connections I had quite a list of connections too look for in order to find the uuid of the network I wanted to join and enable the network with the suitable command. So I wanted to delete all the connections from hotels, airports and places that I am not visiting anymore. Obviously I could have done this by hand. But its much more fun to do it automatically and on the long term it is really faster when you are mastering your bash tools (:

So here we go with a step by step explanation of the following command that will remove all your network connections that you have never used:

 Bash |  copy code |? 
1
2
$ for i in `nmcli c | grep "never" | grep -o --  "[0-9a-fA-F]\{8\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{12\}"` ; do nmcli connection delete uuid $i ; done
3

ok let us first see the connections that I had in my manager

 Bash |  copy code |? 
1
2
$ nmcli connection
3

which would give me the following list

 Bash |  copy code |? 
001
002
NAME                      UUID                                   TYPE              TIMESTAMP-REAL                    
003
Lobby                     0f91bb0d-e2be-4f8a-a00e-457c8bdaf9a9   802-11-wireless   never                             
004
TTH-Zentral               2d3ddca9-772f-47d9-99a1-1559640b0f25   802-11-wireless   never                             
005
attwifi                   6be3c5aa-fc85-415c-96e4-5583b25c23bb   802-11-wireless   never                             
006
uni-koblenz               8a0d1d51-672c-4ded-ad92-18e27b8215df   802-11-wireless   Do 16 Apr 2015 18:11:45 CEST      
007
greenscafe                22dd0f8e-be2d-4402-af82-7716222add75   802-11-wireless   never                             
008
WLAN-2DD138               5308ed9e-5def-430e-85f4-e1eb01426927   802-11-wireless   never                             
009
Fairfield_GUEST           b72080e0-c5dd-492a-b8a3-017fe7d6099c   802-11-wireless   never                             
010
Hotel Sylter Hof          d7c8fc6c-64e3-435f-b2c0-316c1f11ddf1   802-11-wireless   never                             
011
TELENETHOTSPOT            1345bcda-26ab-4193-904c-088235d29873   802-11-wireless   never                             
012
CHI_ECRC_2013             a316f6be-bb4c-4501-867b-6928f9f429ef   802-11-wireless   never                             
013
AndroidAP5270             b5c5462c-072e-4e90-a3b2-def467562579   802-11-wireless   never                             
014
hotel_harvey              7c6d1794-6d45-40aa-b7ac-f9a7f401d02e   802-11-wireless   never                             
015
free-hotspot.com          dc7351ce-ca6c-413e-ae8b-a82c2093525e   802-11-wireless   never                             
016
PAT-WLAN                  4662b075-9519-4f69-8ce9-b938ea8270c1   802-11-wireless   never                             
017
dlink                     5dab3493-cdd8-4d6c-a7a2-6def0836c2a5   802-11-wireless   never                             
018
TTHKasse                  b9c2f9d9-aeda-454b-941b-bb1ccfc0ad9a   802-11-wireless   never                             
019
BTOpenzone-B              bede9d3a-9fc1-4dc2-9c75-0d2686c225f1   802-11-wireless   never                             
020
MBTA_WIFI_Car0385_Box-068 17ac549c-574c-4bf4-a464-6b633f2a4ac3   802-11-wireless   never                             
021
Wireless connection 1     17b18b79-411d-4d69-813d-6506f38b8ea5   802-11-wireless   never                             
022
MBTA_WiFi_Car0620_Box-199 c36c572e-e469-4e86-a50f-87d6d68f4f7e   802-11-wireless   never                             
023
*VIPARIS_WIFI             0593b927-644b-4604-a479-4fc652b6050d   802-11-wireless   never                             
024
test                      836af61a-8268-4a16-a5ab-036f3e0cf7e9   802-11-wireless   So 15 Sep 2013 21:18:35 CEST      
025
WL1A                      46b6496f-6583-4306-a58f-4e4d2bdd5d50   802-11-wireless   never                             
026
Hochhaus                  f6b80571-37d5-4bcd-b558-62084c61622b   802-11-wireless   never                             
027
FreeWifi                  379f9efd-b91d-433f-8ce2-209e4ed2099b   802-11-wireless   never                             
028
NETCONNECT-6202           2f84b475-a852-49ac-a236-61b3f0bc9548   802-11-wireless   never                             
029
stolteraa                 d789f49e-2643-4894-96a8-4e10ea3cbb69   802-11-wireless   never                             
030
ALICE-WLAN28              17e4838f-bbaf-470c-bf24-9de948b42b00   802-11-wireless   never                             
031
NAS QNAP                  ef6a08df-1c7c-48ba-b476-f3ff3b1e2669   802-3-ethernet    Mi 15 Apr 2015 11:03:51 CEST      
032
WLAN-8CA902               3046307e-69a3-4c99-89fb-b79f7f9ee24b   802-11-wireless   Mi 01 Apr 2015 11:42:27 CEST      
033
MfN-Guest                 25d3765f-dcca-4f40-872a-8ffcfe307f25   802-11-wireless   never                             
034
FRITZ!Box Fon WLAN 7360   7c428f50-078d-442a-9ba7-268853c888f0   802-11-wireless   Mo 11 Feb 2013 23:39:08 CET       
035
Arcor-362007-L            87a2d11c-3a3d-4b5e-a1b0-cc5b38916035   802-11-wireless   Di 14 Apr 2015 17:42:33 CEST      
036
Telekom_ICE               8763adcc-f27b-441f-9184-594128871351   802-11-wireless   So 29 Mär 2015 19:56:35 CEST      
037
IBMVISITOR                48227bb6-63e8-4a58-8b8f-1929f76d8ef2   802-11-wireless   never                             
038
OWL                       13ff2ed5-8ecf-4d67-b039-a3bc4cce56d9   802-11-wireless   never                             
039
Parkhotel Kraehennest     e763a256-4a2d-4813-b354-57ad8f642e2a   802-11-wireless   never                             
040
EasyBox-AD3112            e4f342ae-d20b-4abc-9fe2-52b208d6b61b   802-11-wireless   never                             
041
BTOpenzone                860cf4c0-45eb-4a57-a01e-cfd54933387f   802-11-wireless   never                             
042
southshore                274cfaa8-2c08-4abc-bef3-3fd2608060b8   802-11-wireless   never                             
043
annanet                   06b3b3bc-a264-4d05-a848-3b5d6df9eed0   802-11-wireless   never                             
044
shared                    806c9806-fadc-472f-8460-318babbd38ea   802-3-ethernet    Fr 10 Apr 2015 09:39:50 CEST      
045
vidiu                     3abf0848-b09c-457e-9c7a-958728f2c59f   802-11-wireless   never                             
046
wlan 1                    ad9e4a07-b66f-4f3f-8f6d-4f5a81b2ed54   802-11-wireless   never                             
047
CITYHOTEL                 dec05243-06b6-4477-8813-0491b436f993   802-11-wireless   never                             
048
eduroam                   f844713b-a726-4b5b-98a5-3b35411c4cf5   802-11-wireless   never                             
049
Starlight-HotSpot         6842159f-94e9-4f5d-8a76-93b1f4c32912   802-11-wireless   never                             
050
Dr_l)P35_21_22#342C5C     e307b6e8-598b-4bd1-b47f-dc8a34ff12e0   802-11-wireless   never                             
051
iPhone 5                  9070ee1c-8ac1-4458-a590-cf241685b929   802-11-wireless   never                             
052
Lummerland                7d2d4d89-9eb7-45c0-a963-a8a240e33100   802-11-wireless   Mo 10 Feb 2014 22:35:03 CET       
053
AndroidAP4089             ec201acc-9e6f-4c7b-9da8-6ed4539dde6c   802-11-wireless   never                             
054
heartofgold               437e2b7d-5b76-4e3e-a101-698776293ede   802-11-wireless   never                             
055
09FX09039648              e2cc4508-e18e-4c0c-a694-633ace5d095a   802-11-wireless   never                             
056
WIRELESS_BEN_GURION_AIRPORT 8ff2846d-9e84-4175-8c4d-968e226e7a43   802-11-wireless   never                             
057
Telekom                   60aded97-f697-48c6-8070-91e1b786df82   802-11-wireless   Mi 15 Apr 2015 00:14:14 CEST      
058
Marriott_CONF             a4ec2c22-8a31-46bb-a146-a02d8f7b2582   802-11-wireless   never                             
059
TTH-Seminar4+5            23422256-0a4b-45b5-8394-43c92592564d   802-11-wireless   never                             
060
FRITZ!Box 7330 SL         a431f83e-6a73-4cf1-94ee-4409c19dfdb9   802-11-wireless   Do 13 Feb 2014 18:45:48 CET       
061
mycloud                   f3fcf1ae-eebb-4e37-a700-96035d0aea59   802-11-wireless   never                             
062
ArcorWirelessLAN          428769c9-3dfc-43f0-a2dc-29f3c4ecb0fb   802-11-wireless   never                             
063
TP-LINK_PocketAP_7329E2   a17a19b4-251e-41d7-a82e-1add52ec1317   802-11-wireless   never                             
064
TTH-Taunus                fbb24cae-c2aa-4057-be67-095b80604f5e   802-11-wireless   never                             
065
BWI-WiFi                  58e749f6-58e9-44fe-8528-6a1e3bacc88f   802-11-wireless   never                             
066
uni vpn                   b28d76f8-57d2-4548-8959-9c47e189221e   vpn               never                             
067
Miri :)                   74147f40-07c4-4e91-8a43-8c69bc733479   802-11-wireless   never                             
068
wiew7                     7193e045-9570-4d16-b4b6-d676fc19d05a   802-11-wireless   never                             
069
ZurichAirport             0fe8cde1-de8b-48f9-9ca0-52ac129e9876   802-11-wireless   never                             
070
mercure                   f3fbf40d-7c2b-4e6d-b5db-fce6888bb719   802-11-wireless   never                             
071
HITRON-A600               501ac6d9-6912-46a1-9681-4a73e1009fe0   802-11-wireless   never                             
072
HTC Portable Hotspot 61EF 3675cadc-251a-487c-8c4d-cf3747117f13   802-11-wireless   never                             
073
FRITZ!Box 7312            a7d9b99d-63bc-4caa-b82c-1da9fec95cea   802-11-wireless   never                             
074
o2-WLAN38                 76a67dd7-3d50-4388-ba9f-07f52a328eca   802-11-wireless   never                             
075
ALICE-WLAN36              e55d0ccd-7941-4da0-8ac8-99ed22adda49   802-11-wireless   never                             
076
WEBPORTAL                 e2ce59eb-fa7d-4ece-88b7-bd0585a8d589   802-11-wireless   never                             
077
FOSDEM                    0cc3584b-1a5e-41fd-944e-df85f0a2d418   802-11-wireless   never                             
078
BRITZ!Fox Fon WLAN 7360 SL fc70206c-04c8-4ae6-a0fd-7f769addf0b6   802-11-wireless   never                             
079
Hotel Amsee3              f4ff9826-22d2-4f9b-91d9-8c63dc0f9bd4   802-11-wireless   So 29 Mär 2015 11:56:21 CEST      
080
ibis                      a348ed30-2fcf-4068-ba1c-176cdd9e7b10   802-11-wireless   never                             
081
O2 Wifi                   8935490d-313f-4fd0-b1fd-c78ab138af51   802-11-wireless   never                             
082
FRITZ!Box Fon WLAN 7270   50d62587-5a48-4635-b30f-fbb1ded20455   802-11-wireless   Di 30 Dez 2014 12:23:23 CET       
083
Ambassador-Opera          fdefea8c-d218-4632-bb07-b67ddb63f778   802-11-wireless   never                             
084
HOTEL BB                  05d9792c-6f9e-48a6-9c0c-6c03a9708954   802-11-wireless   never                             
085
MBTA_WiFi_Car0353_Box-104 24a1527c-3083-44f3-8812-cacafb88cf7a   802-11-wireless   never                             
086
theairline                54770eb9-78f2-4a3b-86cf-0e594a55c9f9   802-11-wireless   never                             
087
republicansareontheirown  074ca340-643c-411e-95eb-d6e78f887fcf   802-11-wireless   never                             
088
VPN/WEB                   4a5f132b-81c2-49ba-8934-0257f98e5a54   802-11-wireless   never                             
089
WLAN-6A1EA7               d2e80ec0-9bd3-4801-bada-65a695f7dc92   802-11-wireless   never                             
090
Mahler                    1d59c9a1-090c-4333-b2af-4154d5edd9c2   802-11-wireless   never                             
091
guest-access              c0ff03ac-a195-46a7-a507-5c1cf5c7f668   802-11-wireless   never                             
092
Schlummerland             3d029511-2627-458a-a06b-e2c8e86d26b4   802-11-wireless   never                             
093
MSDSL2                    f2fbd0b7-26f6-4939-aece-c2c9d3621e40   802-11-wireless   Do 16 Apr 2015 20:28:22 CEST      
094
Urania                    846e76bc-b96f-40aa-a30f-b6d2f84fd7f0   802-11-wireless   never                             
095
CJDDSAWLN                 55158cdb-07cc-4c02-8f44-a19ec2aeca06   802-11-wireless   never                             
096
AndroidAP                 375e398a-1b2e-4d2e-b4a5-4c05c904b109   802-11-wireless   Fr 02 Jan 2015 16:29:17 CET       
097
gesis-guest               b9a00edd-9e28-4549-8f13-2634577c1276   802-11-wireless   never                             
098
guests@WMDE               9aeccb7b-e629-4f0a-ab81-5300c7c433c0   802-11-wireless   never                             
099
Wired connection 1        30ffcf0e-5181-41b0-b7d4-402de875889f   802-3-ethernet    Mo 04 Mär 2013 15:10:44 CET       
100
wlan                      a2f073a8-f0b0-4f58-a79a-2f22131016b1   802-11-wireless   never                             
101
Wired connection 2        700ebb58-f049-4ec7-bac6-cd5801a975e2   802-3-ethernet    Do 16 Apr 2015 18:11:44 CEST      
102
Wired connection 3        bf70a943-9510-4883-ba64-a4bede826120   802-3-ethernet    Do 16 Apr 2015 09:26:08 CEST      
103
30 Min. Free Wi-Fi - Vodafone f5cd9efa-d735-41d5-a90f-ba83357f2e40   802-11-wireless   never                             
104
WIKIMEDIA                 a40d0c35-8232-42db-b5a2-2118d69d6c41   802-11-wireless   never                             
105
loganwifi                 41e42d9c-efe9-45c5-9f8e-a2f5f441dd73   802-11-wireless   never                             
106
WL3D                      efe99726-557a-4595-90e8-9c0fc3ee0c20   802-11-wireless   never                             
107
m3connect                 6ce7f634-5c44-4818-a055-cb32dca20738   802-11-wireless   never                             
108
MIRI-PC_Network           d1243377-9aed-4abf-8207-90b47840a48f   802-11-wireless   never                             
109
innflux                   bd5be404-6a8b-402a-8a6f-856eaa054664   802-11-wireless   never                             
110
LRTA24open2               dc95a098-107f-46c9-8d36-23cf575a319f   802-11-wireless   never                             
111
LRTA24open3               5166cb9a-20ff-4d5c-b224-88f0b2276398   802-11-wireless   never                             
112
Boingo Hotspot            954559e9-5f8c-4f9b-b2bc-36ff23f18d4a   802-11-wireless   never    
113

the interesting part is the fourth column which is luckily saying never if a connection was never used. so that is an easy grep:
 Bash |  copy code |? 
1
2
nmcli c | grep "never"
3

from this list I need the second colum in particular the uuids. I could have done this with some awk magic but I decided greping for uuids should be easier so lets pipe the output to another grep:

 Bash |  copy code |? 
1
2
nmcli c | grep "never" | grep -o --  "[0-9a-fA-F]\{8\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{12\}"
3

as we can see the regular expression is really straight forward. there are two arguments given first of all -o that is to only output what was matched and not the complete lines and the helps for greping hyphens. The cool thing is with having the web and search engines you don’t even have to build this regular expression on your own. Click on my search query for an blog article explaining the background: grep regular expression uuid

Next we have to iterate over the result and use it in the nwcli connection delete command. From the docu of nmcli we know

 Bash |  copy code |? 
01
02
Usage: nmcli connection { COMMAND | help }
03
  COMMAND := { list | status | up | down | delete }
04
 
05
  list [id <id> | uuid <id>]
06
  status [id <id> | uuid <id> | path <path>]
07
  up id <id> | uuid <id> [iface <iface>] [ap <BSSID>] [--nowait] [--timeout <timeout>]
08
  down id <id> | uuid <id>
09
  delete id <id> | uuid <id>
10

so the code should look something like:

 Bash |  copy code |? 
1
2
nmcli connection delete uuid 954559e9-5f8c-4f9b-b2bc-36ff23f18d4a
3

only that 954559e9-5f8c-4f9b-b2bc-36ff23f18d4a will be replaced by all the uuids from my grep statements.

so let’s put this big grep in a loop and just echo everything to see if it is working. just use backticks around the grep and make a loop:

 Bash |  copy code |? 
01
02
$ for i in `nmcli c | grep "never" | grep -o --  "[0-9a-fA-F]\{8\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{12\}"` ; do echo $i ; done
03
0f91bb0d-e2be-4f8a-a00e-457c8bdaf9a9
04
2d3ddca9-772f-47d9-99a1-1559640b0f25
05
6be3c5aa-fc85-415c-96e4-5583b25c23bb
06
22dd0f8e-be2d-4402-af82-7716222add75
07
5308ed9e-5def-430e-85f4-e1eb01426927
08
b72080e0-c5dd-492a-b8a3-017fe7d6099c
09
d7c8fc6c-64e3-435f-b2c0-316c1f11ddf1
10
1345bcda-26ab-4193-904c-088235d29873
11
a316f6be-bb4c-4501-867b-6928f9f429ef
12
b5c5462c-072e-4e90-a3b2-def467562579
13
7c6d1794-6d45-40aa-b7ac-f9a7f401d02e
14
dc7351ce-ca6c-413e-ae8b-a82c2093525e
15
4662b075-9519-4f69-8ce9-b938ea8270c1
16
5dab3493-cdd8-4d6c-a7a2-6def0836c2a5
17
b9c2f9d9-aeda-454b-941b-bb1ccfc0ad9a
18
bede9d3a-9fc1-4dc2-9c75-0d2686c225f1
19
17ac549c-574c-4bf4-a464-6b633f2a4ac3
20
17b18b79-411d-4d69-813d-6506f38b8ea5
21
c36c572e-e469-4e86-a50f-87d6d68f4f7e
22
0593b927-644b-4604-a479-4fc652b6050d
23
46b6496f-6583-4306-a58f-4e4d2bdd5d50
24
f6b80571-37d5-4bcd-b558-62084c61622b
25
379f9efd-b91d-433f-8ce2-209e4ed2099b
26
2f84b475-a852-49ac-a236-61b3f0bc9548
27
d789f49e-2643-4894-96a8-4e10ea3cbb69
28
17e4838f-bbaf-470c-bf24-9de948b42b00
29
25d3765f-dcca-4f40-872a-8ffcfe307f25
30
48227bb6-63e8-4a58-8b8f-1929f76d8ef2
31
13ff2ed5-8ecf-4d67-b039-a3bc4cce56d9
32
e763a256-4a2d-4813-b354-57ad8f642e2a
33
e4f342ae-d20b-4abc-9fe2-52b208d6b61b
34
860cf4c0-45eb-4a57-a01e-cfd54933387f
35
274cfaa8-2c08-4abc-bef3-3fd2608060b8
36
06b3b3bc-a264-4d05-a848-3b5d6df9eed0
37
3abf0848-b09c-457e-9c7a-958728f2c59f
38
ad9e4a07-b66f-4f3f-8f6d-4f5a81b2ed54
39
dec05243-06b6-4477-8813-0491b436f993
40
f844713b-a726-4b5b-98a5-3b35411c4cf5
41
6842159f-94e9-4f5d-8a76-93b1f4c32912
42
e307b6e8-598b-4bd1-b47f-dc8a34ff12e0
43
9070ee1c-8ac1-4458-a590-cf241685b929
44
ec201acc-9e6f-4c7b-9da8-6ed4539dde6c
45
437e2b7d-5b76-4e3e-a101-698776293ede
46
e2cc4508-e18e-4c0c-a694-633ace5d095a
47
8ff2846d-9e84-4175-8c4d-968e226e7a43
48
a4ec2c22-8a31-46bb-a146-a02d8f7b2582
49
23422256-0a4b-45b5-8394-43c92592564d
50
f3fcf1ae-eebb-4e37-a700-96035d0aea59
51
428769c9-3dfc-43f0-a2dc-29f3c4ecb0fb
52
a17a19b4-251e-41d7-a82e-1add52ec1317
53
fbb24cae-c2aa-4057-be67-095b80604f5e
54
58e749f6-58e9-44fe-8528-6a1e3bacc88f
55
b28d76f8-57d2-4548-8959-9c47e189221e
56
74147f40-07c4-4e91-8a43-8c69bc733479
57
7193e045-9570-4d16-b4b6-d676fc19d05a
58
0fe8cde1-de8b-48f9-9ca0-52ac129e9876
59
f3fbf40d-7c2b-4e6d-b5db-fce6888bb719
60
501ac6d9-6912-46a1-9681-4a73e1009fe0
61
3675cadc-251a-487c-8c4d-cf3747117f13
62
a7d9b99d-63bc-4caa-b82c-1da9fec95cea
63
76a67dd7-3d50-4388-ba9f-07f52a328eca
64
e55d0ccd-7941-4da0-8ac8-99ed22adda49
65
e2ce59eb-fa7d-4ece-88b7-bd0585a8d589
66
0cc3584b-1a5e-41fd-944e-df85f0a2d418
67
fc70206c-04c8-4ae6-a0fd-7f769addf0b6
68
a348ed30-2fcf-4068-ba1c-176cdd9e7b10
69
8935490d-313f-4fd0-b1fd-c78ab138af51
70
fdefea8c-d218-4632-bb07-b67ddb63f778
71
05d9792c-6f9e-48a6-9c0c-6c03a9708954
72
24a1527c-3083-44f3-8812-cacafb88cf7a
73
54770eb9-78f2-4a3b-86cf-0e594a55c9f9
74
074ca340-643c-411e-95eb-d6e78f887fcf
75
4a5f132b-81c2-49ba-8934-0257f98e5a54
76
d2e80ec0-9bd3-4801-bada-65a695f7dc92
77
1d59c9a1-090c-4333-b2af-4154d5edd9c2
78
c0ff03ac-a195-46a7-a507-5c1cf5c7f668
79
3d029511-2627-458a-a06b-e2c8e86d26b4
80
846e76bc-b96f-40aa-a30f-b6d2f84fd7f0
81
55158cdb-07cc-4c02-8f44-a19ec2aeca06
82
b9a00edd-9e28-4549-8f13-2634577c1276
83
9aeccb7b-e629-4f0a-ab81-5300c7c433c0
84
a2f073a8-f0b0-4f58-a79a-2f22131016b1
85
f5cd9efa-d735-41d5-a90f-ba83357f2e40
86
a40d0c35-8232-42db-b5a2-2118d69d6c41
87
41e42d9c-efe9-45c5-9f8e-a2f5f441dd73
88
efe99726-557a-4595-90e8-9c0fc3ee0c20
89
6ce7f634-5c44-4818-a055-cb32dca20738
90
d1243377-9aed-4abf-8207-90b47840a48f
91
bd5be404-6a8b-402a-8a6f-856eaa054664
92
dc95a098-107f-46c9-8d36-23cf575a319f
93
5166cb9a-20ff-4d5c-b224-88f0b2276398
94
954559e9-5f8c-4f9b-b2bc-36ff23f18d4a
95

that looks great so replace the echo with the real command:

 Bash |  copy code |? 
1
2
nmcli connection delete uuid $i
3

this will lead to the follwing final command which is identical to the one on the top of the article but just with some line breaks for better readability.

 Bash |  copy code |? 
1
2
$ for i in `nmcli c | \
3
  grep "never" | \
4
  grep -o --  "[0-9a-fA-F]\{8\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{12\}"` ; \
5
  do nmcli connection delete uuid $i ; \
6
 done
7

Now I only have a few connections in my network manager so that I can easily switch connections from the command line depending on where I am:

 Bash |  copy code |? 
01
02
$ nmcli c
03
NAME                      UUID                                   TYPE              TIMESTAMP-REAL                    
04
AndroidAP                 375e398a-1b2e-4d2e-b4a5-4c05c904b109   802-11-wireless   Fr 02 Jan 2015 16:29:17 CET       
05
FRITZ!Box 7330 SL         a431f83e-6a73-4cf1-94ee-4409c19dfdb9   802-11-wireless   Do 13 Feb 2014 18:45:48 CET       
06
NAS QNAP                  ef6a08df-1c7c-48ba-b476-f3ff3b1e2669   802-3-ethernet    Mi 15 Apr 2015 11:03:51 CEST      
07
MSDSL2                    f2fbd0b7-26f6-4939-aece-c2c9d3621e40   802-11-wireless   Do 16 Apr 2015 20:28:22 CEST      
08
shared                    806c9806-fadc-472f-8460-318babbd38ea   802-3-ethernet    Fr 10 Apr 2015 09:39:50 CEST      
09
Hotel Amsee3              f4ff9826-22d2-4f9b-91d9-8c63dc0f9bd4   802-11-wireless   So 29 Mär 2015 11:56:21 CEST      
10
Lummerland                7d2d4d89-9eb7-45c0-a963-a8a240e33100   802-11-wireless   Mo 10 Feb 2014 22:35:03 CET       
11
FRITZ!Box Fon WLAN 7270   50d62587-5a48-4635-b30f-fbb1ded20455   802-11-wireless   Di 30 Dez 2014 12:23:23 CET       
12
Arcor-362007-L            87a2d11c-3a3d-4b5e-a1b0-cc5b38916035   802-11-wireless   Di 14 Apr 2015 17:42:33 CEST      
13
Telekom                   60aded97-f697-48c6-8070-91e1b786df82   802-11-wireless   Mi 15 Apr 2015 00:14:14 CEST      
14
Wired connection 3        bf70a943-9510-4883-ba64-a4bede826120   802-3-ethernet    Do 16 Apr 2015 09:26:08 CEST      
15
FRITZ!Box Fon WLAN 7360   7c428f50-078d-442a-9ba7-268853c888f0   802-11-wireless   Mo 11 Feb 2013 23:39:08 CET       
16
test                      836af61a-8268-4a16-a5ab-036f3e0cf7e9   802-11-wireless   So 15 Sep 2013 21:18:35 CEST      
17
Wired connection 1        30ffcf0e-5181-41b0-b7d4-402de875889f   802-3-ethernet    Mo 04 Mär 2013 15:10:44 CET       
18
Telekom_ICE               8763adcc-f27b-441f-9184-594128871351   802-11-wireless   So 29 Mär 2015 19:56:35 CEST      
19
Wired connection 2        700ebb58-f049-4ec7-bac6-cd5801a975e2   802-3-ethernet    Do 16 Apr 2015 18:11:44 CEST      
20
WLAN-8CA902               3046307e-69a3-4c99-89fb-b79f7f9ee24b   802-11-wireless   Mi 01 Apr 2015 11:42:27 CEST      
21
uni-koblenz               8a0d1d51-672c-4ded-ad92-18e27b8215df   802-11-wireless   Do 16 Apr 2015 18:11:45 CEST
22

If you like this post, you might like these related posts:

  1. Download network graph data sets from Konect – the koblenz network colection UPDATE: now with link to the PhD thesis. By the...
  2. Create a Screencast in Ubuntu with recordmydesktop and do Soundengineering and post production I promised to create some screen casts for the autocomplete...
  3. Version control of your Linux config with git I was just reading through the recent notes of Heinrich...

Sharing:

Tags: , , , , , , ,

Leave a Reply

*

Close

Subscribe to my newsletter

You don't like mail?