Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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:
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;
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.
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 IBMSystem/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 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.
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.
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..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.