Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

thanks

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
5  
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
2  
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
10.6.3
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.