Update cheatsheets

This commit is contained in:
ivuorinen
2025-08-17 00:22:45 +00:00
parent 38ecb2b6c5
commit 42c0c33dde
259 changed files with 1079 additions and 386 deletions

View File

@@ -5,16 +5,22 @@ source: https://github.com/tldr-pages/tldr.git
---
# compgen
> A built-in command for auto-completion in Bash, which is called on pressing `<Tab>` key twice.
> Bash built-in command for generating possible completion matches in Bash.
> Usually used within custom completion functions.
> See also: `complete`, `compopt`.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-compgen>.
- List all commands that you could run:
- List all shell built-ins, aliases, functions and executables that you could run:
`compgen -c`
- List all commands that you could run that start with a specified string:
- List all commands that you could run that start with a specified string and save results to `COMPREPLY`:
`compgen -c {{str}}`
`compgen -V COMPREPLY -c {{str}}`
- Match against a wordlist:
`compgen -W "{{apple orange banana}}" {{a}}`
- List all aliases:
@@ -35,7 +41,3 @@ source: https://github.com/tldr-pages/tldr.git
- List all users on the system:
`compgen -u`
- Display help:
`compgen --help`