Glam Prestige Journal

Bright entertainment trends with youth appeal.

Using the command line on Debian, how can make the system forget the wireless networks I previously connected to?

Thanks.

3 Answers

I assume your wireless interface is named after wlan0 but please modify it according to your setting.

You could try:

  • sudo dhclient -r wlan0 (-r flag will renew or release the current IP addr from your wirless interface).

You can also do:

  • sudo dhclient wlan0 to request a new IP.
2

Got the right answer here:

My adaptation to the given solution with a small python script:

#! /usr/bin/env python
import commands
import os
res = commands.getstatusoutput("nmcli -t -f TYPE,UUID con")
lines = res[1].split('\n')
for line in lines: parts = line.split(":") if (parts[0] == "802-11-wireless"): os.system("nmcli connection delete uuid "+ parts[1])
print ">> Done."
os.system("nmcli connection")
1

To forget a single network first run

nmcli -t -f TYPE,UUID,NAME con 

to get a list of all the networks. The output will include something like this:

802-11-wireless:12345678-31d1-51e7-a60e-3a52e52b4495:YourWifiName

Copy the string of numbers/letters which is the UUID.

Then run

sudo nmcli c delete 12345678-31d1-51e7-a60e-3a52e52b4495

replacing the UUID with your own.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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