Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I noticed this is other OSes as well, but most visibly in Ubuntu Linux. Whenever a good request is made, it is computed practically instantly. However, whenever a bad request is made (a bad password, a non-existent command, etc) it takes a few seconds before it lets me try to give input again. Is this some kind of security measure?

share|improve this question

3 Answers 3

up vote 6 down vote accepted

Generic answer to generic question: a 'bad request' is determined to be 'not found' only after searching all possibilities for a match and finding none. However, when something is 'found', it is usually specific enough to be found very quickly, and not all possibilities need to be checked before determining it is 'found'.

share|improve this answer
7  
I would also add that when a command is not found, Ubuntu looks up if a similarly-named program is installed or available in the repositories, which also takes some time but is often helpful –  Sergey Nov 11 '11 at 0:38
1  
If it bothers you, you can remove the functionality Sergey refers to by removing the packages command-not-found and command-not-found-data. You will have to reopen your Terminal to make it fully "take", ie flush out some old existing bash aliases and functions that it used. I personally do this, then typos don't take half as long to recover from, you get an instant "command not found". –  Caesium Dec 14 '11 at 23:16

I agree with kyleN's answer regarding why typing a wrong command in terminal takes longer then starting an existing program.

A pause after entering a wrong password, however, is a completely different matter - this delay is introduced intentionally to prevent brute-force password attacks (i.e. trying thousands of passwords a second until one matches). Adding a small delay when an incorrect password is entered doesn't affect usability for "real" users but makes such attacks completely impractical. So yes, in this case it's a security measure.

share|improve this answer

The delay after entering a wrong password is done deliberately for security reasons.

The delay when entering a wrong command line into the terminal is a side-effect caused by Ubuntu having some extra mechanics that trigger when a command isn't found. Instead of just printing "command not found", Ubuntu searches it's repository to see if the command you typed is provided by a program you don't have currently installed and then gives instructions on how to install it. That search can take a second or two.

share|improve this answer

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.