1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/compgen.md

29 lines
576 B
Markdown
Raw Normal View History

2018-03-31 17:51:22 +08:00
# compgen
> A built-in command for auto-completion in Bash, which is called on pressing `<Tab>` key twice.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-compgen>.
2018-03-31 17:51:22 +08:00
- List all commands that you could run:
`compgen -c`
- List all commands that you could run that start with a specified string:
`compgen -c {{str}}`
2018-03-31 17:51:22 +08:00
- List all aliases:
`compgen -a`
- List all functions that you could run:
`compgen -A function`
- Show shell reserved keywords:
2018-03-31 17:51:22 +08:00
`compgen -k`
- See all available commands/aliases starting with 'ls':
`compgen -ac {{ls}}`