We help IT Professionals succeed at work.

How to add cc and gcc in $ PATH? i am using RHEL 5

aloknet21
aloknet21 asked
on
Medium Priority
1,999 Views
Last Modified: 2012-05-06
How to add cc and gcc in $ PATH? i am using RHEL 5
Comment
Watch Question

Top Expert 2009

Commented:
Normlay to add permanatenly path you go to

cd /home/usrname/

then vi bash_profile

add the path before EXport path line
Top Expert 2009

Commented:
if you do

whereis gcc

it sould show you someting like that

bash-3.2# whereis gcc
gcc: /usr/bin/gcc /usr/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz


or you can add this line in your bash_profile before export line

gcc=/usr/bin/gcc

or export CC=/usr/bin/gcc
or
export gcc=/usr/bin/gcc

Commented:
You can also use: which gcc , in order where the executable is.

But I don't think is that the problem... /usr/bin should be in the PATH ..

@aloknet21,

Are you sure you have gcc installed?

Can you run this command and paste the output here?:

rpm -qa | grep gcc
CERTIFIED EXPERT
Top Expert 2007
Commented:
you may do the following:

find / -name cc -o -name gcc

then add the dir to PATH

PATH=$PATH:/path/to/dir ; export PATH

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
got the right answer. thanks a lot for help!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.