1828076 Members
3764 Online
109974 Solutions
New Discussion

How HPUX commands work.

 
SOLVED
Go to solution
someone_4
Honored Contributor

How HPUX commands work.

Hey everyone happy monday.
I have been looking around the directory tree. And looking closely at
/sbin /bin /usr/sbin /bin. I tried to look at the commands .. more command but they are not text files. And then I noticed that some commands are in all 4 directories like rm. Now I am just wondering why are the commands all in differnt directories and why are some in all 4? Basicly how do HPUX commands work.

Thanks
Richard
6 REPLIES 6
Patrick Wallek
Honored Contributor
Solution

Re: How HPUX commands work.

Commands are only in 2 different places:

/sbin

and

/usr/bin

/bin is a link to /usr/bin so all commands will show as being in both places if you do an ll.

The reason for some commands being in both places is, in a nutshell, single-user mode.

When you boot up in single-user mode, the only LV that is available is /, since not all root LVs are mounted by default in single-user mode. So the only directory available with user commands is /sbin. Most of the commands in /sbin are also compiled such that they do not require any external libraries.

When you come up in multi-user mode then all other LVs get mounted and all commands in /usr/bin and whatever libraries they might need are then available to you. You could also accomplish the same thing in single-user mode by manually mounting all vg00 LVs.

Does this make sense?
Sanjay_6
Honored Contributor

Re: How HPUX commands work.

Hi Richard,

There are some command which are used when the system is in single user mode. Like vg manipulation commands. When the system boots into single user mode, the /usr filesystem is not mounted but you still get the functionality of the same command which are there in /usr/sbin, because there are some of the same commands in /etc /sbin etc. These are almost the same, but with some advanced functionality available or unavailable.

Hope this helps.

Regds
Sridhar Bhaskarla
Honored Contributor

Re: How HPUX commands work.

/sbin is of interest to us. This has the commands that are not dynamically linked. For ex., /sbin/mv is different from /usr/bin/mv.
They are helpful during single user mode, when /usr is not available or when there are problems with dynamic libraries like dld.sl etc.,

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Helen French
Honored Contributor

Re: How HPUX commands work.

Hi Richard,

How do HP-UX commands work?

When you have successfully logged into HP-UX, the shell monitors input from your terminal. The shell accepts typed lines from the terminal, splits them into command names and arguments, then executes the command. The command can be the name of a shell built-in, an executable script of commands, or an executable program. There is nothing special about system-provided commands, except that they are kept in directories where the shell can find them. You can also keep commands in your own directories and arrange for the shell to find them there.


See this for useful information:
http://www.docs.hp.com/hpux/onlinedocs/B2355-90128/B2355-90128.html

HTH,
Shiju
Life is a promise, fulfill it!
Wodisch
Honored Contributor

Re: How HPUX commands work.

Hello Richard,

I guess you are looking for another explanation - hopefully I meet your expectations ;-)

/sbin = single user binaries: stuff needed in single user mode
/bin = /usr/bin = binaries: stuff needed by everybody
/usr/sbin = sysadmin binaries: stuff needed by sysadmins in multi user mode
/*/lbin = ... (read: I not know a mnemonic): binaries not meant to be executed from command line, but from daemons and the like

And the reason for the start of all this was back in the times of UNIX even before System V, since disks were not big enough to store all commands needed in one place - so the *fathers of UNIX* had to split the list...

HTH,
Wodisc
someone_4
Honored Contributor

Re: How HPUX commands work.

For some reason email notifications are not working. Go figure ..
That makes sense what everyone says.
Makes since. Just for fun I am just going though the whole HPUX directory tree to see what I can find.One command that I found rather intresting was
#leave
leave(1) leave(1)

NAME
leave - remind you when you have to leave

But anyways .. thanks for all your answers.

Richard