I recently compiled and installed diffutils-3.3 as I needed the --no-dereference switch that is unavailable in the included version of diff. After configure, make, make check, make clean, and install the new version 3.3 of diff was installed in /usr/local/bin.
Running diff --version resulted in the same 3.2 as before installation.
commands and their output follow:
$ which diff
/usr/local/bin/diff
$ whereis -b diff
diff: /usr/bin/diff /usr/bin/X11/diff /usr/local/bin/diff
$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Using full paths, I can confirm that diff version 3.3 is in /usr/local/bin and version 3.2 is in /usr/bin.
Looking at the path, I would expect that since /usr/local/bin appears first, that particular diff should be executed when I call diff without a path. Clearly this is not the case. My question is why and what can I do to obtain the desired result?
Note: Ubuntu 12.04.5
$ uname -a
Linux me-AOD270 3.2.0-80-generic #116-Ubuntu SMP Mon Mar 23 17:11:32 UTC 2015 i686 i686 i386 GNU/Linux
diffbeing from/usr/bin, see http://askubuntu.com/a/583912/158442. – muru Apr 25 '15 at 02:37export $PATH$and trying from a previous terminal which worked. – Elder Geek Apr 25 '15 at 02:45