9

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.

ehsanul
  • 427

6 Answers6

16

"uname -m" or "arch"

astrostl
  • 690
6

The command on Linux/UNIX is:

uname -a 

or for just the architecture:

uname -m
Swoogan
  • 2,107
6

From commandlinefu.com:

getconf LONG_BIT
1

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
1

lshw shows the processor register width like this:


sudo lshw -class processor
Ali Mezgani
  • 3,870
0

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

inquisitive
  • 103
  • 4