0
votes
2answers
59 views

Can I use `which` command for partial match?

I want to find all programs with name like "gcc", "gcc-4.2", "gcc-4.9" and so on. To find all binaries I tried with which -a gcc*. But "*" is not recognized as 'any' with which command. Is there ...
8
votes
1answer
2k views

“whereis” and “which” return different paths in Mac OS X

I've got the default OpenSSL 9.8 (Mac OS X 10.6.8) and decided to install the newest version (1.0.1) via MacPorts (sudo port install openssl). These are console output of which and whereis commands: ...
2
votes
3answers
848 views

How do I change the default version of a unix executable?

I currently have two versions of the same executable installed on my OSX machine: one sits in usr/bin, and the other is a Macports installation. When I run which, the terminal returns the location to ...
1
vote
3answers
561 views

The 'which' command returns nothing via cron, but works via console

I've written a little utility in haXe + Neko that needs to execute some GIT commands. To avoid hardcoding the path to the GIT executable I'd like to use the which command to find out where it is. ...
8
votes
3answers
740 views

`which python` points to the python I want, but `python` runs the wrong version

I want to use python24 provided by ports, so I've installed it, and python_select -s shows that the version I want is indeed selected. Running which python gives /opt/local/bin/python, and running ...