Will Linux / UNIX / OS X binaries be stored in the same directories across different platform or distributions? I'm asking because I need to have access to uuidgen
(stored in /usr/bin/uuidgen on my development computer) and noticed that my local Apache server does not include /usr/bin
in the PATH
. I know I could add /usr/bin
to the path, but I want to make sure the software can be re-deployed on a number of different systems with ease. Thanks!
Asked
Active
Viewed 184 times
1

Kevin Sylvestre
- 113
- 4
1 Answers
2
I wouldn't rely on it being there. You should use the which
command to find it's path i.e. which uuidgen
will find it in the user's path. If it's not there, you could use locate uuidgen
to try and get it.

Zypher
- 37,405
- 5
- 53
- 95
-
Will `which` always be located in `/usr/bin`? – Kevin Sylvestre Dec 24 '10 at 00:49
-
`which` is a shell builtin. – Sam Halicke Dec 24 '10 at 01:01
-
You beat me to it. +1 to you! (and Congrats on the new gig!) – gWaldo Dec 24 '10 at 01:06
-
What exactly does a shell built-in imply? The program running under Apache can't find `which` either. – Kevin Sylvestre Dec 24 '10 at 01:31
-
1@Sam which is actually NOT a builtin command - in bash anyway. Which has been at /usr/bin/which on every system i've used. Also the fact apache can't find it makes me think it is running as a user that doesn't have a shell. What user is apache running as? – Zypher Dec 24 '10 at 03:12
-
Heh. Forgot, using `zsh`. In any case, when you're using `which`, specify the full pathname. Since `/usr/bin` isn't in your path already, you'll need to assume (and use) `/usr/bin/which`. – Sam Halicke Dec 24 '10 at 05:36