Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just learned that if you hit and hold ESC while on the Mac Terminal, a prompt appears after a few seconds offering to show every command available on your system, including aliases, built-ins, and executables on your PATH.


However, the output is show through a more filter, and I cannot grep it or pipe it to another command.

Does anyone know how this magic output is generated? Is it just generated on the fly by Terminal? Is there a bash command that can be called explicitly on the command line and get the same result?

It is mostly curiosity, but I would love to be able to get the results as text I can post-process and not just browse on screen.

share|improve this question
Retagged because it's a bash feature. – Ignacio Vazquez-Abrams Jun 14 '10 at 6:55
Great, thanks. That's a start: at least now I know it is not but bash the one who does the trick. – Sergio Acosta Jun 14 '10 at 7:23
Related:… – Chris Johnsen Jun 14 '10 at 8:35
Just press Esc twice at an empty prompt - no need to hold it down. – Dennis Williamson Jun 14 '10 at 10:35
up vote 2 down vote accepted

As Ignacio Vazquez-Abrams commented, this functionality comes from the bash completion feature. The compgen built-in command provides access to the functionality.

You can access the command completion like this:

# all commands
compgen -c
# command starting with "ls"
compgen -c ls
share|improve this answer
Wow, much better. Thanks a lot! – Sergio Acosta Jun 14 '10 at 17:29

Your Answer


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.