Operating System - HP-UX
1748089 Members
5097 Online
108758 Solutions
New Discussion

Re: GCC installed but not showing in /usr/bin /sbin /sbin

 
SOLVED
Go to solution
Yaboto
Super Advisor

GCC installed but not showing in /usr/bin /sbin /sbin

Hi,

I installed GCC but when i execute #which gcc, the reply is: no gcc in /usr/bin /usr/sbin /sbin.

What should i do?

Thanks

2 REPLIES 2
Patrick Wallek
Honored Contributor

Re: GCC installed but not showing in /usr/bin /sbin /sbin

It's not in your PATH, which is set up by default with the /etc/PATH file.  You will need to add the path to the gcc executable to the /etc/PATH file, then the next time you log in it will be there.

 

GCC may be in /usr/local/bin.

Bill Hassell
Honored Contributor
Solution

Re: GCC installed but not showing in /usr/bin /sbin /sbin

The commands: which and whereis are not very useful.
The command: type <string>
will show you how the <string> will be interpreted. But if there is no response to: type gcc
then the gcc executable is not in your shortcut called $PATH. The purpose of $PATH is to create a shortcut to the full path such as /usr/local/bin/gcc or /usr/contrib/bin/gcc or /whatever_path.

When you installed gcc, there should have been some details shown about the location for gcc. But if that information is gone or was never shown, use find to locate the executable like this:

# find /usr /opt -name gcc -exec ls -ld {} \;

DO NOT use: find / as it may take days to run if your system has petabytes of filesystem storage.

If you find the gcc compiler in /usr/local/bin, you can add the path to $PATH by editing /etc/PATH and then login again.

 



Bill Hassell, sysadmin