Take the 2-minute tour ×

I'm writing a shell script, and I need to know the architecture, i.e. PPC or Intel. Back in the day, there was a program /bin/arch that told you, but my mac doesn't seem to have it... Is there an easy way I can do this? Grep for something in a logfile? call some other program that spits that out as a side effect?

It would be nice to know what OS Version I'm running too, but that may not be necessary.


share|improve this question

3 Answers 3

up vote 10 down vote accepted

There are many ways, but try uname -a.

share|improve this answer
uname -p gives just the processor architecture. man uname for other options. –  Doug Harris Jun 3 '10 at 16:55

uname -m seems to output the same information as /bin/arch.

share|improve this answer
Not with me. arch outputs i368 and uname -m outputs x84_86. I run OSX on a 64bit machine. –  Erik Aigner Dec 18 '12 at 19:35
@ErikAigner: Typo, perhaps? Shouldn't it be x86_64? –  Dennis Williamson Dec 19 '12 at 6:02
Of course arch should return x86_64, that's why it's so strange. But I don't know why. –  Erik Aigner Dec 19 '12 at 7:31

arch is available in /usr/bin/arch

You can get OS version information with sw_vers

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.6.3
BuildVersion:   10D573
$ sw_vers -productVersion
share|improve this answer

Your Answer


