LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-11-2009, 11:19 AM   #1
foampile
Member
 
Registered: Feb 2009
Posts: 50

Rep: Reputation: 15
Question 32- or 64-bit ?


hello everyone. i was curious what command would tell me if my instance is 32- or 64-bit ? the reason i do not know of the bat is because i am connected to someone else's machine.

uname -a just says:

Linux domU-12-31-38-00-31-F8 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 athlon i386 GNU/Linux
 
Old 02-11-2009, 11:21 AM   #2
jstephens84
Senior Member
 
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
I think it would actually pop up with something to the effect of x86_64 but not for sure as even on 64 bit I usually ran 32 bit OS's.
 
Old 02-11-2009, 11:33 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
As already stated by jstephens84 the uname command tells you if the installed kernel is 32 or 64 bit. If you want to know if the CPU is 32 or 64 bit, look at the output of cat /proc/cpuinfo. If you see the flag lm it is a 64-bit CPU, otherwise it is 32-bit. For example on a 64-bit machine:
Code:
$ cat /proc/cpuinfo
processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      :               Intel(R) Pentium(R) 4 CPU 3.40GHz
stepping        : 3
cpu MHz         : 3400.094
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc pebs bts pni monitor ds_cpl est cid cx16 xtpr
bogomips        : 6800.11
clflush size    : 64
cache_alignment : 128
address sizes   : 36 bits physical, 48 bits virtual
power management:
Notice the flag highlighted in red.
 
Old 02-11-2009, 11:34 AM   #4
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
uname -a is already telling you that you have 32 bit system.i386 is telling you that.If there was x86-64 that would mean that it's a 64 bit system.Here's one more command to check it;
Code:
getconf -a | grep WORD_BIT
 
Old 02-11-2009, 11:47 AM   #5
Matey
Member
 
Registered: Jan 2009
Posts: 114

Rep: Reputation: 17
I also wonder if you can ls the /boot/ directory and see which kernel is loading? sometimes it is in the name of the kernel file like;
vmlinuz-2.6.19-4-generic-amd64
but that is not the good way of doing it. bcs most of the times the arch. is not in the name.


Quote:
model name : Intel(R) Pentium(R) 4 CPU 3.40GHz
dammm... is that really 3.4 Giga Hertz?

Last edited by Matey; 02-11-2009 at 11:50 AM.
 
Old 02-11-2009, 11:51 AM   #6
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by alan_ri View Post
Here's one more command to check it;
Code:
getconf -a | grep WORD_BIT
That doesn't seem like a reliable method of determining whether you're running 32bit or 64bit:

Code:
mike@continuity:~$ uname -a
Linux continuity 2.6.27.7-9-default #1 SMP 2008-12-04 18:10:04 +0100 x86_64 x86_64 x86_64 GNU/Linux
mike@continuity:~$ uname -m
x86_64
mike@continuity:~$ getconf -a | grep WORD_BIT
WORD_BIT                           32
mike@continuity:~$
 
Old 02-11-2009, 12:16 PM   #7
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
Well,allow me to quote something;
Quote:
This same situation has recently recurred in the same line, as the AMD64 architectural extensions bring the 64-bit size into a major position without dropping any of the 16- and 32-bit support.
Thus one sees that today a computer architecture is based on a family of closely related sizes more than on a single omnipresent word size. The sizes are intimately related to one another by integral factors, usually a power of two. Calling any one of them the architecture's word size may be somewhat arbitrary, and a size may be so designated due to the history of the architecture's evolution rather than the properties of the size itself in a recent design.
and
Quote:
As computer designs have grown more complex, the central importance of a single word size to an architecture has decreased. Although more capable hardware can use a wider variety of sizes of data, market forces exert pressure to maintain backward compatibility while extending processor capability. As a result, what might have been the central word size in a fresh design has to coexist as an alternative size to the original word size in a backward compatible design. The original word size remains available in future designs, forming the basis of a size family.
and this;
Quote:
When a computer architecture is designed, the choice of a word size is of substantial importance. There are design considerations which encourage particular bit-group sizes for particular uses (e.g. for addresses), and these considerations point to different sizes for different uses. However, considerations of economy in design strongly push for one size, or a very few sizes related by multiples or fractions (submultiples) to a primary size. That preferred size becomes the word size of the architecture.
Character size is one of the influences on a choice of word size. Before the mid-1960s, characters were most often stored in six bits; this allowed no more than 64 characters, so alphabetics were limited to upper case. Since it is efficient in time and space to have the word size be a multiple of the character size, word sizes in this period were usually multiples of 6 bits (in binary machines). A common choice then was the 36-bit word, which is also a good size for the numeric properties of a floating point format.
After the introduction of the IBM System/360 design which used eight-bit characters and supported lower-case letters, the standard size of a character (or more accurately, a byte) became eight bits. Word sizes thereafter were naturally multiples of eight bits, with 16, 32, and 64 bits being commonly used.
I hope that things are clearer now.
 
Old 02-11-2009, 01:06 PM   #8
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Quote:
Originally Posted by arizonagroovejet View Post
That doesn't seem like a reliable method of determining whether you're running 32bit or 64bit:

Code:
mike@continuity:~$ uname -a
Linux continuity 2.6.27.7-9-default #1 SMP 2008-12-04 18:10:04 +0100 x86_64 x86_64 x86_64 GNU/Linux
mike@continuity:~$ uname -m
x86_64
mike@continuity:~$ getconf -a | grep WORD_BIT
WORD_BIT                           32
mike@continuity:~$
I believe that query should be

getconf LONG_BIT


WORD_BIT will return 32 for either a 32 or 64 bit system ..
 
Old 02-11-2009, 01:10 PM   #9
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by farslayer View Post
I believe that query should be

getconf LONG_BIT


WORD_BIT will return 32 for either a 32 or 64 bit system ..
LONG_BIT does indeed seem like the one to look at

Code:
mike@continuity:~$ uname -m
x86_64
mike@continuity:~$ getconf -a | grep LONG_BIT
LONG_BIT                           64
Just logged in to a machine at work which I know runs a 32bit install and that has a LONG_BIT value of 32.
 
Old 02-11-2009, 01:10 PM   #10
TITiAN
Member
 
Registered: Mar 2008
Location: NRW, Germany
Distribution: Arch Linux, using KDE/Plasma
Posts: 392

Rep: Reputation: 49
Quote:
Originally Posted by Matey View Post
I also wonder if you can ls the /boot/ directory and see which kernel is loading? sometimes it is in the name of the kernel file like;
vmlinuz-2.6.19-4-generic-amd64
but that is not the good way of doing it. bcs most of the times the arch. is not in the name.



dammm... is that really 3.4 Giga Hertz?
i have the same with 3.4 Ghz too
 
Old 02-11-2009, 01:50 PM   #11
GibsoneanNode
Member
 
Registered: Jan 2009
Distribution: Desktop- Debian 4.0
Posts: 43

Rep: Reputation: 16
The contents of the recent thread How to check whether kernel is 32 bit or 64 bit in linux also concerns this topic.

With both that and this thread in mind, it seems as though methods of making this 32-bit or 64-bit determination are in contention.

GNU/Linux is perhaps at its best when there are a variety of ways to accomplish a task, so if not uniformity, shouldn't there be a favored way of going about this process? One that would elevate the need for dispute? Also, might that method's output, in the case of reading flags, be less arcane than discerning the meaning of a two character abbreviation for Long Mode?

The 2007 thread /proc/cpuinfo flag lm discusses how to find out the meaning of flag abbreviations.
 
Old 02-11-2009, 07:02 PM   #12
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
the problem with your flag question is that even though a CPU may be capable of 64 bit (this having the lm flag) that doesn't mean your kernel or OS was compiled and is running a 64 Bit Kernel.

Checking the CPU flags tells you if the hardware can support 64 Bit (cat /proc/cpuinfo, dmidecode, lshw, )

uname -a and getconf LONG_BIT tell you if the OS is 64 bit..

One is a hardware check the other is software so they are in effect two different things. Keep in mind most x86_64 CPU's can happily run either a 32 bit or 64 bit OS..
 
Old 02-11-2009, 07:44 PM   #13
aussie_penguin
LQ Newbie
 
Registered: Feb 2009
Distribution: Fedora & OpenSolaris 8
Posts: 9

Rep: Reputation: 1
my response under OpenSolaris 8 is as follows....

uname -a | getconf LONG_BIT
32
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
64 bit cpu-64 bit Ubuntu-are there 32 bit app issues? sofasurfer Ubuntu 7 04-09-2014 02:02 PM
64-bit or 32-bit Application on 64-bit Linux jjana123 Linux - General 4 05-06-2008 05:27 PM
Triple Boot Suse 10.3 32 bit, suse alpha 11.0 64 bit and Windows XP (32 Bit) 1kyle SUSE / openSUSE 1 02-28-2008 10:25 AM
no KDE in Kubuntu 6.10 64-bit(ATI X800 GTO 256 bit DDr3) exul182 Linux - Hardware 2 01-04-2007 02:47 PM
32 bit or 64 bit install - is 32 bit easier for a newbie? dms05 Linux - Newbie 3 05-19-2006 03:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration