如何从保存的列表中删除访问点

操作系统:带有gnome-shell的Ubuntu 11.10

我保存的列表上的访问点很少,我想删除并且从不连接。 我似乎无法找到删除这些的方法。

如何从保存的访问点列表中删除(至少不自动连接)?

ctrl + t {for terminal prompt} cd /etc/NetworkManager/system-connections sudo rm {wireless_hotspot_name} 

希望有所帮助

从一年后编辑

这似乎变成了一个相当受欢迎的答案,所以我继续编写了一个自动化脚本来为每个人做这个。 只需将以下脚本复制到/usr/local/bin/wireless ,记得运行命令sudo chmod +x /usr/local/bin/wireless

很高兴看到这是不断帮助其他* buntu用户;)最新版本将在GitHub上

 #!/bin/bash # Review and Remove Wireless Access Points on DEB based Systems # Make sure to place script in /usr/local/bin # CPR : Jd Daniel :: Ehime-ken # MOD : 2013-12-09 @ 12:27:02 # INP : $ wireless -{flag} {arg} ##===============================================================## ##===============================================================## clear # If the user is not root if [ "$(id -u)" != "0" ]; then echo "This script must be run as root" 1>&2 ; exit 1 fi declare -r VERSION='1.2b' declare -r net_dir='/etc/NetworkManager/system-connections' function list () { cd "${net_dir}" export count=$(ls |wc -l) # used in drop function files=$(ls) # simple ls echo -e "\n\tFound ${count} wireless connections" for f in $files; do echo -e "\t * $f" done } function drop () { # make sure that we have a working file and directory... cd "${net_dir}" ; [ -f "$OPTARG" ] || { echo -e "\n\tConnection does not exist..." ; exit 1; } # confirmation for removal printf "\n\tDo you want to delete $OPTARG [y/n] " ; read -r resp # strtolower, and rm if [ 'y' == "$(echo $resp | awk '{print tolower($0)}')" ]; then rm -f ${net_dir}/${OPTARG} fi } function flush () { # make sure that we have a directory with files... cd "${net_dir}" ; list ; [ 0 -ge "${count}" ] && { echo -e "\tExiting, Nothing to flush..." ; exit 1 ; } # confirmation for removing all files printf "\n\tAll Wireless Connections will be removed, continue? [y/n] " ; read -r resp # strtolower, and rm if [ 'y' == "$(echo $resp | awk '{print tolower($0)}')" ]; then rm -f ${net_dir}/* fi } function version () { echo -e "\n\twireless (GNU wireless network purge) v${VERSION}" echo -e "\n\tCopyright (C) 2013 Hydra Code, LLC." echo -e "\tLicense GPLv3+: GNU GPL version 3 or later .\n\tThis is free software: you are free to change and redistribute it.\n\tThere is NO WARRANTY, to the extent permitted by law." echo -e "\n\n\tWritten by Jd Daniel (Ehime-ken) http://github.com/ehime" exit 0 } function help () { echo -e "\n\tUsage: wireless [OPTION]... [FILE]..." echo -e "\tList, remove single or flush the contents of your Wireless Network Manager" echo -e "\n\tThe options below may be used to perform the above actions, this program will only" echo -e "\trun a single flag or parameter at a time. Flag chaining is only available for -d" echo -e "\t -l, --list \t\t List the contents of your 'Network Manager'" echo -e "\t -d, --drop [conn] \t Drop a single (or multiple) wireless connections" echo -e "\t -f, --flush \t\t Flush all wireless connections." echo -e "\t --help \t\t Display this help menu and exit" echo -e "\t --version \t Display version information and exit" exit 0 } ##===============================================================## ##===============================================================## # no long-opts supported except --help while getopts ':ld:f-:' OPT; do case $OPT in l) list ;; d) dirList="${dirList} $OPTARG" ; drop ;; f) flush ;; -) #long option case $OPTARG in list) list ;; drop) drop ;; flush) flush ;; help) help ;; version) version ;; esac ;; : ) echo -e "\n\tMissing option argument for -$OPTARG" >&2; exit 1;; * ) echo -e "\n\tUnknown flag supplied ${OPTARG}\n\tTry wireless --help"; exit 1;; esac done shift $(($OPTIND - 1)) ##===============================================================## ##===============================================================## 

删除从未使用的所有连接(无需root)

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

打开网络管理器,如果您使用它的顶角的小程序。 转到编辑连接菜单,然后单击无线选项卡。 只需删除您不需要的所有接入点。

似乎从菜单“编辑连接”,您可以找到单击顶部面板(Ubuntu Unity)上的图标,您只能删除无线连接。 如果您有其他网络,如电话网络,则必须在/etc/NetworkManager/system-connections文件夹中删除它们。 您必须成为root才能删除该文件夹中的任何子文件夹。

例如,要删除我的HTC evo的网络,我必须这样做:

 sudo rm -R /etc/NetworkManager/system-connections/Network\ HTC\ EVO\ 3D\ X515m 

除了其他答案中提到的选项之外,您还可以使用网络管理器应用程序忘记网络或避免自动连接,以防您想要保留网络信息。

  1. 单击右上角,显示Wi-fi按钮。 单击它,然后单击Wi-Fi设置 (或通过设置 > 网络 )。
  2. 在网络管理器中,确保您在Wi-Fi部分(左侧菜单)上,然后单击要编辑的网络旁边的齿轮图标。
  3. 将出现一个新窗口。 如果要删除网络,请转到左侧列表中的“ 重置”选项,然后选择“ 忘记” 。 与该网络相关的所有数据都将被删除,并再次使用它,您需要再次提供密码。
  4. 如果您只是想避免自动连接,请转到“ 标识”选项(也在左侧列表中),然后取消选中“ 自动连接”复选框。