0

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

1 Answer 1

1

Solution

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .