Create a linux alias to list all available commands

williamlake

William Lake

Posted on November 3, 2019

Create a linux alias to list all available commands

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Source: https://stackoverflow.com/a/949006

💖 💪 🙅 🚩
williamlake
William Lake

Posted on November 3, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related