Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

commands like hostname and rsh where are they located

Status
Not open for further replies.

Chrissirhc

Programmer
May 20, 2000
926
0
0
GB
Hi,

Just a convention type question:

Should commands like hostname and rsh always reside in usr/bin??? is that a good standard?

Thanks,

Chris
 
No, In HP-UX
# which rsh
/bin/rsh


# which hostname
/bin/hostname
 
Commands are in /usr/bin and are also in /bin (at least on the systems I use). Why shouldn't they be in /usr/bin?
 
cakecop, /bin happens to be first in your PATH. Those commands are also in /usr/bin.
 
ok.

Is there anywhere, where a convention is written?

There are directories usr/bin, usr/local/bin, usr/ucb
with duplication of some of the files in them.

It is a little confusing...

Thanks,

Chris

 
/usr/bin is where the executables for the Unix system are located. They are what are installed when the OS is installed.

/usr/local/bin is where shareware executables are usually stored.

And /usr/ucb is where the commands that were originally developed under BSD are stored.

And then, of course, some Unix systems use /opt for the commands that are associated with non-OS software.

Each flavor of Unix may have its own variations (HP doesn't have /usr/ucb, for example). That's why they pay Unix sys admins the big bucks![wink]

 
The duplicate files in /bin and /usr/bin may not be duplicates. On Solaris, the directory /bin is just a soft link to the directory /usr/bin, so it's really only one directory.

Normally /bin and /usr/bin are executables installed with the OS. /usr/local/bin or /opt is usually any third party applications that have been installed.

Hope this helps.

 
And /bin on Solaris is usually just a symbolic link to /usr/bin anyway...

Annihilannic.
 
In theory /bin holds the executables that are required to get the system through initial load. These would be exec's that are needed before any other filesystems are mounted. If mount is in /usr/bin, but /usr is a seperate file system then you have a catch 22. These are also the file exec's that are required in single user mode/maint shells.
 
Actually, the directory [tt]/sbin[/tt] is the critical one for booting the OS. These are statically linked executables for the critical boot and init functions. They're statically linked because file systems with run time libraries may not be mounted when these are needed to run.

Hope this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top