Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

location of command binaries among Linux distirbutions.

Dude!Feb 25 2012 — edited Feb 28 2012
Hi,

If /usr/bin is the primary directory to store command binaries and /bin the location of essential commands, then distributions like Debian and Red Hat seem to have a different understanding of what commands are essential. Commands like basename, awk, etc. are stored in /bin under Red Hat, but /usr/bin under Debian Linux.

Does anybody know the reason why?

For a bash script to be compatible with all existing Linux distributions and in order to avoid shell environment aliases, path, etc, I wonder if was enough to simply check if a command executable exists in /usr/bin, and if not, assume it is stored in /bin instead.

Would this be sufficient?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 27 2012
Added on Feb 25 2012
6 comments
489 views