Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Often when I mistype a command such as ls (e.g. I hit ENTER before I type 's') there is a long (~2s) delay after the terminal displays:

bash: l: command not found...

I can understand the reasons for a similar delay after an incorrect password is entered, per Why a wrong password gives a big delay. But why delay after an unrecognized command? Does FAIL_DELAY in /etc/login.defs affect this also?

share|improve this question
5  
Maybe Fedora is now also using that horrible Ubuntu misfeature that tells you "This program is not installed, to install it, type ..."? The delay is then caused by searching the database of all installable packages. Try calling psql (part of PostgreSQL), which is probably not installed by default, but is hopefully in the repositories. –  Ulrich Schwarz Nov 29 '11 at 18:51
    
What does echo "$PROMPT_COMMAND" output? –  rozcietrzewiacz Nov 29 '11 at 19:28
    
echo "$PROMPT_COMMAND": printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}" –  paislee Nov 29 '11 at 19:48
    
what echo $PATH prints ? your system is check there each time you hit the return key. –  Hanan N. Nov 29 '11 at 21:22
add comment

3 Answers 3

up vote 9 down vote accepted

after some research i have found this:

  • try to uninstall the command-not-found package with $>yum remove command-not-found then install it again with >$yum install command-not-found (just in case you have that package installed on your system).

if that doesn't help try:

  • add this to your ~/.bashrc file:

    unset command_not_found_handle

share|improve this answer
1  
Second suggestion removed the delay. I do not have the package command-not-found installed. Thanks! –  paislee Nov 29 '11 at 21:53
add comment

Fedora uses something similar.

If you want to just remove this feature use:

yum remove PackageKit-command-not-found
share|improve this answer
    
Follow up: I forgot to mention if you remove this package you will get an error message: bash: /usr/libexec/pk-command-not-found: No such file or directory To fix this create the file after removeing the package, /usr/libexec/pk-command-not-found with the following: #!/bin/sh echo "Command not found: $1" This will print: Command not found: fail-command –  user16852 Mar 21 '12 at 5:31
add comment

I found that the best solution, at least on Fedora, is to modify the configuration file
/etc/PackageKit/CommandNotFound.conf

as the biggest delay comes from the search for packages to install, if you modify SoftwareSourceSearch=true in SoftwareSourceSearch=false

the delay is almost 0 and you still get warned about misspellings, which can be useful.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.