Linux / BSD Shell Doesn't Recognize Newly Installed Binaries

in Categories , , , , , , last updated June 17, 2009

I‘ve installed few software using tar ball format under Linux or FreeBSD ports using make command. However, my system doesn’t recognize the installed command. I’ve to reboot the system or log out and log in again to use the same. How do I fix this problem?

Almost all modern shell remembers program location and cache the result to speed up operation. Shell has something called hash table which is nothing but the contents of the directories in the path ($PATH) variable to be recomputed. To flush cache simply type the following under bash:
# hash -r
If you are using CSH, type:
# rehash
This is needed if new commands are added to directories in path while you are logged in. This should be necessary only if you add commands to one of your own directories, or if a systems programmer changes the contents of one of the system directories. Also flushes the cache of home directories built by tilde expansion.

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+.

Share this on (or read 0 comments/add one below):