Fedora17-command not found-命令延時

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功能。

 

另外,“SimilarNameSearch”這一條也可以考慮關掉:

 

# 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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章