Why Command Not Found Causes Long Delay in Bash

bashcommand linecommand-not-foundfedora

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 is there a big delay after entering a wrong password?. But why delay after an unrecognized command? Does FAIL_DELAY in /etc/login.defs affect this also?

Best Answer

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