LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 12-04-2013, 05:42 PM   #1
ali.abry
Member
 
Registered: Feb 2013
Posts: 74

Rep: Reputation: Disabled
confused over uname options (-i -p -m)


Hi every body
I just confused over thees options in uname command.
what's the difference between :
Code:
uname -i
uname -p
uname -m
and which one shows that kernel is 32 bit or 64 bit ?
 
Old 12-04-2013, 06:13 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,750

Rep: Reputation: 271Reputation: 271Reputation: 271
"which one shows that kernel is 32 bit or 64 bit ?"

uname -r

------------------------
Steve Stites
 
Old 12-04-2013, 06:18 PM   #3
ali.abry
Member
 
Registered: Feb 2013
Posts: 74

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jailbait View Post
"which one shows that kernel is 32 bit or 64 bit ?"

uname -r

------------------------
Steve Stites
for me it doesn't show the bit number . its just show kernel version
Code:
aliabry@lp:~$ uname -r
3.2.0-56-generic
 
Old 12-04-2013, 06:46 PM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
heres mine:
Code:
[schneidz@hyper ~]$ uname -r
2.6.43.8-1.fc15.x86_64
[schneidz@hyper ~]$ uname -i
x86_64
[schneidz@hyper ~]$ uname -m
x86_64
[schneidz@hyper ~]$ uname -p
x86_64
 
Old 12-05-2013, 05:09 AM   #5
ali.abry
Member
 
Registered: Feb 2013
Posts: 74

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by schneidz View Post
heres mine:
Code:
[schneidz@hyper ~]$ uname -r
2.6.43.8-1.fc15.x86_64
[schneidz@hyper ~]$ uname -i
x86_64
[schneidz@hyper ~]$ uname -m
x86_64
[schneidz@hyper ~]$ uname -p
x86_64
so whats the difference between thees options ? all of them show one thing .
 
Old 12-05-2013, 06:04 AM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by ali.abry View Post
so whats the difference between thees options ? all of them show one thing .
None. All they do is select different parts of the system version string (uname -a).

It is a Red Hat naming convention that puts the X86-64 or whatever into that string. Some information (like node name) do come from other areas, but most of the info is optional and up to the person configuring the kernel. Cat the file /proc/version for a lot of additional information too. Including the host the kernel was compiled on, when, GCC version used,...

The kernel Makefile by default uses various locations to build up the full string:
Code:
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
And the EXTRAVERSION is optional. A lot of the specification can be set at the very beginning of the kernel Makefile. From an older vanilla kernel (3.9.0) the Makefile has:

Code:
VERSION = 3
PATCHLEVEL = 9
SUBLEVEL = 0
EXTRAVERSION =
NAME = Unicycling Gorilla

Last edited by jpollard; 12-05-2013 at 06:09 AM.
 
1 members found this post helpful.
Old 12-05-2013, 06:32 AM   #7
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
Seems to differ depending on the distro. Here's mine, running Slackware64, 14.1:
Code:
bash-4.2$ uname -r
3.10.17
bash-4.2$ uname -i
AuthenticAMD
bash-4.2$ uname -p
AMD Athlon(tm) 64 X2 Dual Core Processor 5200+
bash-4.2$ uname -m
x86_64
 
Old 12-05-2013, 06:53 AM   #8
GazL
Senior Member
 
Registered: May 2008
Posts: 4,083
Blog Entries: 1

Rep: Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527
And here's mine, also slackware, but self-built kernel.
Code:
gazl@ws1:~$ uname -r
3.12.3-custom
gazl@ws1:~$ uname -i
GenuineIntel
gazl@ws1:~$ uname -p
Intel(R) Core(TM)2 Duo CPU     E7400  @ 2.80GHz
gazl@ws1:~$ uname -m
x86_64
The suffix on uname -r is taken from the kernel's LOCALVERSION= string, specified in .config (in my case '-custom', in yours '-generic'.
Stock Slackware kernels leave that blank (as can be seen on brian's post above).

I suspect schneidz's are all "x86_64" because he's using virtualisation rather than real hardware, so they're really not a good example.

-i and -p will depend on your processor vendor and chip.
-m will give you x86_64 for an "AMD64"/"Intel 64" processor, and is the one you should be checking.
 
Old 12-05-2013, 07:21 AM   #9
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 505

Rep: Reputation: 137Reputation: 137
For me, although using real hardware, the result is still same.

Code:
$ uname -ipm
x86_64 x86_64 x86_64

$ uname -r
2.6.32-431.el6.x86_64

$ arch
x86_64

$ lscpu | sed -ne 1,2p -e 10p
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Vendor ID:             GenuineIntel
 
Old 12-05-2013, 08:42 AM   #10
turtleli
Member
 
Registered: Aug 2012
Location: UK
Posts: 206

Rep: Reputation: Disabled
The -i and -p (and also -o) options aren't in the POSIX standard. Different distros can and do patch these options in different ways to provide some form of output (e.g. Slackware uses info from /proc/cpuinfo), so IMO those options are useless.

uname -m shows the machine architecture the kernel believes it is running on, and according to stackoverflow, if the kernel is 32-bit it will report a 32-bit architecture even if it is running on 64-bit hardware.
 
Old 12-05-2013, 09:15 AM   #11
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,027

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
Quote:
Originally Posted by GazL View Post
...
I suspect schneidz's are all "x86_64" because he's using virtualisation rather than real hardware, so they're really not a good example...
nope
 
Old 12-05-2013, 09:23 AM   #12
GazL
Senior Member
 
Registered: May 2008
Posts: 4,083
Blog Entries: 1

Rep: Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527
Ahh well, it was a reasonable guess given the "hyper" hostname.
 
Old 12-05-2013, 11:09 AM   #13
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by schneidz View Post
nope
definitely. He is using Fedora 15. Here is a full string from Fedora 16:

Code:
$ uname -a
Linux panther 3.6.11-4.fc16.x86_64 #1 SMP Tue Jan 8 20:57:42 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Note the multiple occurrences of x86_64. Each one is a different field extracted by uname.

What is shown is entirely up to the person that compiles the kernel. Different distributions have different standards, so what you get will be different.
 
Old 12-05-2013, 11:45 AM   #14
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by schneidz View Post
nope
definitely. He is using Fedora 15. Here is a full string from Fedora 16:

Code:
$ uname -a
Linux panther 3.6.11-4.fc16.x86_64 #1 SMP Tue Jan 8 20:57:42 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Note the multiple occurrences of x86_64. Each one is a different field extracted by uname.

What is shown is entirely up to the person that compiles the kernel. Different distributions have different standards, so what you get will be different.
 
Old 12-05-2013, 01:49 PM   #15
GazL
Senior Member
 
Registered: May 2008
Posts: 4,083
Blog Entries: 1

Rep: Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527Reputation: 1527
Quote:
Originally Posted by jpollard View Post
What is shown is entirely up to the person that compiles the kernel. Different distributions have different standards, so what you get will be different.
Unlike other distros slackware doesn't meddle with things unnecessarily. We see what upstream intended. I'm not surprised that Fedora shows something else. They mess with everything.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] modifying stream id of ip options Error options (unknown 136) MegaMindd Programming 0 06-07-2011 10:17 AM
Confused in ffmpg options mynameisthomas Linux - Newbie 1 04-18-2009 10:26 AM
uname -i stevesk Linux - Newbie 10 08-03-2006 12:21 AM
Uname ? phr3nzal Linux - Software 4 10-07-2005 09:52 AM
Confused about kernel compilation options toolkit Linux - General 3 11-21-2002 10:34 PM


All times are GMT -5. The time now is 10:44 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration