我需要找到给定 Linux 可执行文件的完整路径吗?我怎样才能做到这一点?
例如 cat 的真实路径是 /bin/cat
使用which
或locate
:
$ which cat
/bin/cat
您可以使用 which 命令:
$ which ifconfig
/sbin/ifconfig
which program
或者whereis 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