문제

I'm writing a mac app (osx 10.9) that accesses the terminal commands using NSTask and I wanted to run some of the commands from my app. Where are the terminal commands (gcc, mkdir,git) stored?

도움이 되었습니까?

해결책

Use which to determine this:

% which gcc
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc
% which mkdir
/bin/mkdir
% which git
/Applications/Xcode.app/Contents/Developer/usr/bin/git

다른 팁

They can be scattered all over the place. You can see where individual commands are by using which

which mv
/bin/mv

Also, you can see what are all the paths that are used to search for a given command with the following:

echo $PATH
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top