如何找到输入命令时执行的二进制文件?

Mar*_*oma 7 bash

我刚刚安装了 TeX-Live 2012,但我仍然得到

moose@pc07:~$ latex --version
pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian)
kpathsea version 5.0.0
Copyright 2009 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.2.42; using libpng 1.2.42
Compiled with zlib 1.2.3.3; using zlib 1.2.3.3
Compiled with poppler version 0.12.4
Run Code Online (Sandbox Code Playgroud)

所以我想知道我是否能找出我输入时执行的二进制文件所在的latex --version位置。这可能吗?

Rin*_*ind 11

您可以使用

which latex

找出二进制文件的位置。


gle*_*man 9

type命令内置于 bash (which是一个独立程序)。

type latex
Run Code Online (Sandbox Code Playgroud)

type如果您传递-a选项,该命令还可以区分 shell 别名、shell 函数和独立程序:I have an alias forls

$ type -a ls
ls is aliased to `ls -F'
ls is /bin/ls
Run Code Online (Sandbox Code Playgroud)