In a typical Linux shell (bash) it is possible to to hit tab twice, to get a list of all available shell commands.
Is there a command which has the same behaviour? I want to pipe it into grep
and search it.
In a typical Linux shell (bash) it is possible to to hit tab twice, to get a list of all available shell commands.
Is there a command which has the same behaviour? I want to pipe it into grep
and search it.
List all the files in your
PATH variable
(ls all the directories in the PATH). The default user and system commands will be in /bin and /sbin respectively but on installing some software we will add them to some directory and link it using PATH variable."tab" twice & "y" prints all files in the paths of $PATH. So just printing all files in PATH is sufficient.
Just type this in the shell:
This redirect all the commands to a file "my_commands".
You can list the directories straight from
$PATH
if you tweak the field separator first. The parens limit the effect to the one command, so use:(...) | grep ...
It doesn't include shell builtins though.
tabtaby
Similar to @ghoti, but using find: