Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I actually just have shared hosting at Dreamhost, and I'm going to use it to test deploying a MongoDB based application. There are 32-bit and 64-bit pre-built distros, but I don't know which I should install, until I can determine the server's architecture.

I suppose this can be done by detecting the OS version, but I have no idea how to do that. I can ssh in, though not as root of course, since it's a shared server. I just need to know what command or commands can tell me what architecture is being run on.

share|improve this question
    
    
You really don't want to run Mongo 32Bit in production anyway. –  Jacob Jun 17 '13 at 1:29

5 Answers 5

up vote 12 down vote accepted

"uname -m" or "arch"

share|improve this answer

The command on Linux/UNIX is:

uname -a

or for just the architecture:

uname -m
share|improve this answer

I think uname may just show you the version of the operating system that's installed, rather than the underlying hardware architecture. To double check, try:

cat /proc/cpuinfo
share|improve this answer
    
Although true, for his purpose it's irrelevant. He's not installing the OS, he's installing an app on the OS and wants to know which arch of the app to install. –  Swoogan Sep 2 '09 at 21:58
    
It is possible that uname could report i386 or i686 for the kernel. and cpuinfo has a flag for "lm" which means the HW is 64bit. This would mean that your ISP is running a 32bit OS on 64bit architecture. This doesn't change the correct answer but may be useful to know. –  keithosu Sep 3 '09 at 19:33

lshw shows the processor register width like this:


sudo lshw -class processor

share|improve this answer

From commandlinefu.com:

getconf LONG_BIT
share|improve this answer
    
This is the one you want if you are trying to help out someone who is unfamiliar with how being 32/64-bit ties in with the architecture. Whereas most other commands listed here will output i*86 32-bit systems, this one actually tells the user what they are probably looking for in the first place. –  Chris Down Jan 23 '13 at 13:25

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.