I just have installed TeX-Live 2012, but I still get
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
So I've wondered if I could find out where the binary that gets executed when I enter latex --version
is located. Is this possible?
You can use
which latex
to find out the location of a binairy.
The
type
command is built-in to bash (which
is a standalone program).The
type
command can also differentiate between shell aliases, shell functions and standalone programs if you pass the-a
option: I have an alias forls
For simple stand-alone commands the above answers are perfectly correct. However, if you are running complex scripts and you want to know what's happening behind the scenes, the best way is always:
that displays the entire tree of command being executed.
For example, running
ps afxu
while updatinggrub2
withos-prober
enabled produces this output:In this way you can know exactly what is being called by an executable/script in each phase of its execution.