Is there a Linux command that will list all available commands and aliases for this terminal session?
As if you typed 'a' and pressed tab, but for every letter of the alphabet. Or running 'alias' but also returning commands.
Why? I'd like to run the following and see if a command is available:
ListAllCommands | grep searchstr
Why don't you just type:
In the terminal.
The shell will say somehing like
EDIT:
Ok, I take the downvote, because the answer is stupid, I just want to know: What's wrong with this answer!!! The asker said:
Typing the command will tell you if it is available!.
Probably he/she meant "with out executing the command" or "to include it in a script" but I cannot read his mind ( is not that I can't regularly it is just that he's wearing a mind reading deflector )
The others command didn't work for me on embedded systems, because they require bash or a more complete version of xargs (busybox was limited).
The following commands should work on any Unix-like system.
List by folder :
List all commands by name
It's useful to list the commands based on the keywords associated with the command.
Use:
man -k "your keyword"
feel free to combine with:
| grep "another word"
for example, to find a text editor:
man -k editor | grep text
For Mac users (find doesn't have -executable and xargs doesn't have -d):
in debian: ls /bin/ | grep "whatImSearchingFor"
You can always to the following:
The shell will execute command only if they are listed in the path env var anyway.