How I know what version of clang I have installed?

How I know what version of clang I have installed ?


Solution 1:

clang --version

See below:

$ clang --version
Ubuntu clang version 3.5-1ubuntu1 (trunk) (based on LLVM 3.5)
Target: x86_64-pc-linux-gnu
Thread model: posix

Solution 2:

We might have to locate it first since latest versions might not get installed as clang.

In my case, this is the latest version:

$ locate clang
/usr/bin/clang-11
$ clang-11 --version
Ubuntu clang version 11.0.0-++20200916113328+8f2c29681ce-1~exp1~20200916094014.99
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin