Infomercial-style qualifier: These instructions were created on Ubuntu 18.04. Your mileage may vary.
I find myself constantly Googling Linux commands and then promptly forgetting them. This morning I decided to find a better way, and after creating my own process I thought I'd share. Hopefully it's useful to someone in the future.
Bonus: Found something useful along the way: https://www.commandlinefu.com/commands/browse
How To
Create an alias named allcomm
and save it in your .bashrc
.
echo "alias allcomm=\"compgen -A function -abck\"" >> ~/.bashrc
Reload your .bashrc so the changes will take effect.
source ~/.bashrc
Usage
Searching results:
allcomm search_string_here
E.g.
allcomm zip
zip
zipnote
zipcloak
zipgrep
zipinfo
zipsplit
zipdetails
Searching via grep:
allcomm | grep search_string_here
E.g.
allcomm | grep zip
zip
preunzip
unzip
zipnote
unzipsfx
zipcloak
zipgrep
zipinfo
funzip
prezip-bin
mzip
zipsplit
zipdetails
gpg-zip
prezip
bzip2recover
bunzip2
gunzip
gzip
bzip2
Top comments (3)
Combine with the too long didn't read tool
tldr.sh/
Because man pages are only useful as a reference, not as tutorials for common use cases
How to do this with zsh?
Zsh supports bash completion, if you tell it to:
will tell it to load the compatibility "built-ins" which include
compgen
. It's not 100% compatible, but that should get you started.