Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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

marked as duplicate by masegaloeh, MadHatter, fuero, mdpc, Cristian Ciupitu Jul 18 '15 at 16:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

You really don't want to run Mongo 32Bit in production anyway. – Jacob Jun 17 '13 at 1:29
up vote 13 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


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

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

there are five different ways in which it can be done:

  1. uname -a

  2. uname -m

  3. file /sbin/init

  4. arch

  5. through system settings, (for ubuntu > 12.04)

For more details see this blog post

share|improve this answer

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