0

I downloaded Xcode and the command line tools. When I go to the directory "/usr/bin" and enter "ls" in my terminal, I can see gcc listed among the files and directories. However, when I run the command gcc in this directory, I get a message saying: "-bash: gcc: command not found". Why does it say the command can't be found when I can clearly see it listed among the files in my /usr/bin directory?

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
user3772689
  • 265
  • 1
  • 3
  • 6
  • is the execute bit set? – Colin D Aug 22 '14 at 17:10
  • Execute bit? I'm sorry could you explain? And the output to gcc --version I get is: -bash: gcc: command not found. – user3772689 Aug 22 '14 at 17:15
  • Is the item in `/usr/bin` an executable file or perhaps a broken symlink? – nobody Aug 22 '14 at 17:15
  • Show the output of `ls -l /usr/bin/gcc` – nobody Aug 22 '14 at 17:15
  • The output to ls -l /usr/bin/gcc I get is: "lrwxr-xr-x 1 root wheel 7 Aug 22 09:35 /usr/bin/gcc -> gcc-4.2". Is this incorrect? – user3772689 Aug 22 '14 at 17:17
  • Does `/usr/bin/gcc-4.2` exist? – nobody Aug 22 '14 at 17:19
  • No it does not. There is a gcc-4.0 listed in the directory /usr/bin when I "ls", but when I try calling it, it also tells me that it doesn't exist. – user3772689 Aug 22 '14 at 17:22
  • maybe a help: http://stackoverflow.com/questions/25452239/gcc-command-not-found-even-though-it-is-there/25452337?noredirect=1#comment39714666_25452337 – Klaus Aug 22 '14 at 17:39
  • @Klaus: Your link is to a comment on a deleted answer to *this* question, saying that "OS X 10.9 does not use GCC". I'm afraid it's not helpful. – Keith Thompson Aug 22 '14 at 17:56
  • @user3772689: Your `/usr/bin` directory is messed up for some reason. `/usr/bin/gcc` should definitely be a symlink to something that actually exists. Have you been messing around with `/usr/bin` yourself? (You'd need root access to do so.) – Keith Thompson Aug 22 '14 at 17:57
  • You say you *downloaded* Xcode and the command line tools. Did you install them? If so, how? Can you launch the Xcode IDE (the graphical environment)? – Keith Thompson Aug 22 '14 at 18:38
  • I haven't deleted or added anything to /usr/bin manually, no. I did install them. Xcode installed itself as an application I believe, I can launch the IDE. The command line tools I installed by opening the DMG then launching the installer. The installer ran and ended with a message saying it was successfully installed. – user3772689 Aug 22 '14 at 19:16
  • I tried removing the command line tools and Xcode, then reinstalling them. Now gcc simply doesn't show up in /usr/bin even after I've installed the command line tools. Am I doing something wrong? – user3772689 Aug 22 '14 at 19:37
  • I've added some tags that should draw more attention from people who are more likely to have answers. – Keith Thompson Aug 23 '14 at 18:09
  • You might have better luck asking on the Apple-specific site: http://apple.stackexchange.com/ – Keith Thompson Aug 23 '14 at 19:44

0 Answers0