论坛首页 综合技术论坛

Fedora17-command not found-命令延时

浏览 1399 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2012-11-13  

Fedora 17下不小心输入错误一条命令,提示command not found之后,往往还有几秒的延迟,这段时间系统干嘛去了呢?

在Fedora 17里,如果发现刚刚输入的这个命令没有,会自动在网上查找,所以导致command not found提示之后,还有几秒的latency。

 

这个机制是由“PackageKit-command-not-found-0.7.4-3.fc17.x86_64” 包提供的,找到它的配置文件就可以把这几秒远程查找的latency关闭掉:

 

vim /etc/PackageKit/CommandNotFound.conf

 

找到SoftwareSourceSearch=true

# Controls if the tool should search for packages in remote
# software sources. This may introduce a non-trivial delay if the sources
# have not been recently refreshed.
#
# Allowed values are 'true' or 'false'
#
# default=true
SoftwareSourceSearch=true

 

设置为false,就可以关闭掉search功能。

 

另外,“SimilarNameSearc”这一条也可以考虑关掉:

# Controls if the tool should look for similar command names and suggest
# those instead.
#
# Allowed values are 'true' or 'false'
#
# default=true
SimilarNameSearch=true

 

它的功能如下,比如我输入‘sl’,它会提示你相似的命令是‘ls’:

[root@fedora conf]# sl
bash: sl: command not found...
Similar command is: 'ls'

 

---EOF---

--nigelzeng

论坛首页 综合技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics