Is there a command similar to Linux's command-not-found?
Searching Google for "homebrew command-not-found" (without the quotes) one of the results was: Ubuntu’s command-not-found equivalent for Homebrew on OSX

I have not personally tried using it, so I cannot comment on how well it may work.