What is the difference between
Why are there both directories and why do some executable programs exist in both directories?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
/usr/bin : contains executable programs that are part of the operating system and installed by its package manager
/usr/local/bin : default location for executable programs not part of the operating system and installed there by the local administrator, usually after building them from source with the sequence
configure;make;make install. The goal is not to break the system by overwriting a functional program by a dysfunctional or one with a different behavior.
When the same program exists in both directories, you can select which ones will be called by default by rearranging the order of the directories in your