[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


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

Posted on 2009-02-11
Medium Priority
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

ID: 23620245
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

ID: 23620303
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


Expert Comment

ID: 23620559
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

omarfarid earned 2000 total points
ID: 23623155
you may do the following:

find / -name cc -o -name gcc

then add the dir to PATH

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


Author Closing Comment

ID: 31545946
got the right answer. thanks a lot for help!

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses
Course of the Month20 days, 1 hour left to enroll

872 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