Shell - How to find directory of some command?

前端 未结 7 903
既然无缘
既然无缘 2020-12-04 06:56

I know that when you are on shell, the only commands that can be used are the ones that can be found on some directory set on PATH. Even I don\'t know how to see what dirs a

7条回答
  •  独厮守ぢ
    2020-12-04 07:05

    An alternative to type -a is command -V

    Since most of the times I am interested in the first result only, I also pipe from head. This way the screen will not flood with code in case of a bash function.

    command -V lshw | head -n1
    

提交回复
热议问题