For modern versions of xcode the command xcode-select --version
will display the version number of command line tools, whether or not Xcode.app is installed.
I'm answering against the more recent version (where the tools actually are in the Xcode.app pkg), but I'm pretty sure that if the path & output returned by xcode-select -p
, gcc -v
, and llvm-gcc -v/clang -v
are harmonious then they should be the same, i.e.
$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
$ llvm-gcc -v
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
$ clang -v
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
Note that llvm-gcc is a link to clang,
$ls -al /usr/bin/llvm-gcc
lrwxr-xr-x 1 root wheel 5 Oct 19 2014 /usr/bin/llvm-gcc -> clang
so the output of llvm-gcc -v
and clang -v
should be identical although that may or may not be the case for you (see https://stackoverflow.com/a/5708732/602581 for some more details)
xcode command line tools installed version
but got a lot of irrelevant matches. Btw, did Dog G.'s answer work for you?