Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I clean Nm from all the network ID I never get connected too ?

Traveling and moving here and there increase the list of net and I don't need many of them ... so I would like to clean all the network that I never connect too.

I wonder if there is a built in command to clean the list.
I'm not good with bash but I think it is easy to create script and so a cron job.

A good starting point could be nmcli tool and in particular those command:

  • nmcli con delete
  • nmcli con list
share|improve this question
up vote 0 down vote accepted


nmcli --fields UUID,TIMESTAMP-REAL con list | grep never |  awk '{print $1}' | while read line; do nmcli con delete uuid  $line;    done

On newer Ubuntu (15.10) use this command nmcli --fields UUID,TIMESTAMP-REAL con show | grep never | awk '{print $1}' | while read line; do nmcli con delete uuid $line; done

It will be possibe also to use TIMESTAMP field to know how many day/month are passed from last connection, like for example we want to remove connection older than 1 year

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.