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

Posted on 2009-02-11
Last Modified: 2012-05-06
How to add cc and gcc in $ PATH? i am using RHEL 5
Question by:aloknet21
    LVL 29

    Expert Comment

    Normlay to add permanatenly path you go to

    cd /home/usrname/

    then vi bash_profile

    add the path before EXport path line
    LVL 29

    Expert Comment

    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


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

    LVL 6

    Expert Comment

    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 ..


    Are you sure you have gcc installed?

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

    rpm -qa | grep gcc
    LVL 40

    Accepted Solution

    you may do the following:

    find / -name cc -o -name gcc

    then add the dir to PATH

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

    LVL 1

    Author Closing Comment

    got the right answer. thanks a lot for help!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now