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
# 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”這一條也可以考慮關掉:
# those instead.
#
# Allowed values are 'true' or 'false'
#
# default=true
SimilarNameSearch=true
它的功能如下,比如我輸入‘sl’,它會提示你相似的命令是‘ls’:
bash: sl: command not found...
Similar command is: 'ls'
---EOF---
--nigelzeng