Find duplicate executables files

Posted on in Categories Howto, Linux last updated May 16, 2006

Sometime duplicate executable files or alias creates tons of confusion. To find out duplicated executables files you can use chkdupexe command.

It will scan the union of $PATH and a hardcoded list of common locations for binaries. It will report dangling symlinks and duplicately-named binaries.

Examples

$ chkdupexe

Output:

Dangling symlink: /usr/bin/rmic
Dangling symlink: /usr/bin/jar
-rwxr-xr-x 1 root root  38936 Sep 23  2004 /usr/bin/nsupdate
-rwxr-xr-x 1 root root 203960 Jan 26  2005 /usr/sbin/nsupdate
-rwxr-xr-x 1 root root  15139 Apr  6 01:48 /sbin/grub-install
-rwxr-xr-x 1 root root   6453 Apr  1 18:38 /usr/sbin/grub-install

As you see, it is quite easy to identify all those duplicates executables files. There is also some good discussion going on about PATH and aliases.

See also:

Updated for accuracy.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

3 comment

Leave a Comment