Linux command to list all available commands and aliases

前端 未结 20 2352
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 14:11

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

20条回答
  •  清歌不尽
    2020-11-29 14:47

    Use "which searchstr". Returns either the path of the binary or the alias setup if it's an alias

    Edit: If you're looking for a list of aliases, you can use:

    alias -p | cut -d= -f1 | cut -d' ' -f2
    

    Add that in to whichever PATH searching answer you like. Assumes you're using bash..

提交回复
热议问题