LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-09-2008, 10:12 AM   #1
surprise_frnd
LQ Newbie
 
Registered: Sep 2007
Posts: 3

Rep: Reputation: 0
how to check linux kernel is 32 bit or 64 bit


hi all,

can u tell me how can i find the linux installation is 32bit or 64 bit ...?


i have ran the getconf WORD_BIT and getconf WORD_LENGTH .. i am confused.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 01-09-2008, 10:30 AM   #2
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 63
Usually it is in the name of the kernel.

Code:
>$ uname -m
x86_64
Tells me I am running a 64bit kernel or check a binary file on the system if it is 64bit good chance you are running 64bit.

Code:
>$ file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped
 
2 members found this post helpful.
Old 01-09-2008, 10:47 AM   #3
surprise_frnd
LQ Newbie
 
Registered: Sep 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by HappyTux View Post
Usually it is in the name of the kernel.

Code:
>$ uname -m
x86_64
Tells me I am running a 64bit kernel or check a binary file on the system if it is 64bit good chance you are running 64bit.

Code:
>$ file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped


Thanks for the quick response ..

If i run file on any x86_64 system's library under /lib is showing 32 bit LSB executable ..



if its x86_64; the library also should be 64bit executable right ...?

pls advice
 
Old 01-10-2008, 03:39 PM   #4
Harry Seldon
Member
 
Registered: Feb 2004
Distribution: SLES 9
Posts: 112

Rep: Reputation: 15
I don't think it has to. I run 32bit apps on 64bit kernels. I think you just don't get the performance benefits of running true 64bit code on the kernel.
 
Old 01-10-2008, 05:01 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,316

Rep: Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032
cat /proc/cpuinfo - look for "lm" in the flags

Edit: mmmm; didn't read the question. That'll tell you hardware capability. For the kernel, it's in the config, but recently changed.

Last edited by syg00; 01-10-2008 at 05:03 PM.
 
Old 01-10-2008, 05:19 PM   #6
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 60
One certainly can run 32-bit apps on a 64-bit system, if the system is multilib. But you can look at parts of the system itself to verify that it's 64-bit. Like this, for example
Code:
file /sbin/init
/sbin/init: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.16, dynamically linked (uses shared libs), stripped
 
Old 01-30-2008, 11:26 AM   #7
knockout_artist
Member
 
Registered: Sep 2005
Distribution: fedora core 9
Posts: 324

Rep: Reputation: 33
Quote:
uname -m
i686
Quote:
#uname -ar
Linux linux 2.6.22.5-31-default #1 SMP 2007/09/21 22:29:00 UTC i686 i686 i386 GNU/Linux
What am I running here? is that 64 bit OS??
Because some of applications acting like it is 64 bit?
Do I need to go back in i386?
my cpu info
Quote:
cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz
stepping : 10
cpu MHz : 800.000
cache size : 4096 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
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 nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 3995.43
clflush size : 64

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz
stepping : 10
cpu MHz : 800.000
cache size : 4096 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
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 nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 3990.01
clflush size : 64
 
Old 07-26-2011, 09:30 PM   #8
markhud
Ticketmaster OSS
 
Registered: Sep 2008
Posts: 4

Rep: Reputation: 0
Red face

Quote:
Originally Posted by knockout_artist View Post
What am I running here? is that 64 bit OS??
Because some of applications acting like it is 64 bit?
Do I need to go back in i386?
my cpu info
If it was 64-bit, there would be a 64 in it. i386 is old-school 32-bit for the 386, 486, and early Pentiums and AMD. The i686 tag is modern 32-bit OS that includes extensions and performance-enhancements for most Pentium-class CPUs and AMD processors.
 
Old 11-10-2011, 04:30 AM   #9
pavasatya
LQ Newbie
 
Registered: Nov 2011
Posts: 1

Rep: Reputation: Disabled
To know whether our Linux kernel is 32 bit or 64 bit

To know whether our Linux kernel is 32 bit or 64 bit

Use this command getconf LONG_BIT
 
3 members found this post helpful.
Old 11-10-2011, 05:22 AM   #10
cascade9
Senior Member
 
Registered: Mar 2011
Location: Brisneyland
Distribution: Debian, aptosid
Posts: 3,718

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Quote:
Originally Posted by knockout_artist View Post
What am I running here? is that 64 bit OS??
Because some of applications acting like it is 64 bit?
Do I need to go back in i386?
i686, that is 32bit. No need to 'go back' to i386, your CPU has no problems with i686. If its even possible to get an i386 kernel for your distro.....

BTW, "linux 2.6.22.5-31-default", is that openSUSE 10.3? If it is, you should really get a newer version, or a different distro- openSUSE 10.3 has been out of support' for years now (end of life for 10.3 was 31st of October, 2009).

Quote:
Originally Posted by markhud View Post
The i686 tag is modern 32-bit OS that includes extensions and performance-enhancements for most Pentium-class CPUs and AMD processors.
Just FYI, the original 'pentium' class intel CPUs are only i586, not i686. The 1st i686 (P6) intel CPU was the Pentium Pro/Pentium II, the 1st AMD i686 CPU was the athlon, and I honestly forget what the 1st i686 VIA/cyrix CPU was.
 
Old 12-24-2011, 06:19 AM   #11
Dinjy
LQ Newbie
 
Registered: Dec 2011
Posts: 2

Rep: Reputation: Disabled
If you want to check you system kernel than if you will use manually code to check it. it may be that code can be wrong or process can be wrong. but if you will use Linux Boot Disk to check your kernel. than you will get right answer.
 
Old 12-24-2011, 06:52 AM   #12
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,221
Blog Entries: 3

Rep: Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437
Member response

Hi,

Most Gnu/Linux install CD/DVD provide a means to boot the system. You can then use the booted system to diagnose or work on the system in question. One can look at '/proc/cpuinfo' since the booted kernel provides this information. You can also use ' dmidecode' to identify system information.
 
Old 04-21-2012, 12:14 AM   #13
fmds
LQ Newbie
 
Registered: Apr 2012
Posts: 1

Rep: Reputation: Disabled
Thumbs up Command

Quote:
Originally Posted by pavasatya View Post
To know whether our Linux kernel is 32 bit or 64 bit

Use this command getconf LONG_BIT
Thank you!
 
Old 10-16-2012, 09:55 AM   #14
dadoprso
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by HappyTux View Post
Usually it is in the name of the kernel.

Code:
>$ uname -m
x86_64
Tells me I am running a 64bit kernel or check a binary file on the system if it is 64bit good chance you are running 64bit.

Code:
>$ file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped
Sweet thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
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
LXer: Running 32-bit Applications on 64-bit Debian GNU/Linux LXer Syndicated Linux News 2 01-06-2010 12:26 PM
compiling 64 bit kernel in 32 bit linux MadnessASAP Linux - Hardware 6 05-04-2009 11:47 AM
32 bit kernel on 64 bit AMD machine dipsae Linux - Software 5 10-01-2004 10:03 AM
32-bit or 64-bit linux kernel ??? gsundeep Linux - General 2 04-24-2003 08:43 PM


All times are GMT -5. The time now is 11:50 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration