我如何找到linux程序的路径?

时间:2013-09-07 15:25:52

标签: linux shell

我需要找到给定Linux可执行文件的完整路径吗? 我怎么能这样做?

例如,cat的真实路径是/ bin / cat

3 个答案:

答案 0 :(得分:3)

使用whichlocate

$ which cat
/bin/cat

答案 1 :(得分:2)

您可以使用which命令:

$ which ifconfig
/sbin/ifconfig

答案 2 :(得分:1)

which programwhereis program

$  whatis which
which                (1)  - shows the full path of (shell) commands

$  whatis whereis
whereis              (1)  - locate the binary, source, and manual page files for a command