3

Why does this happen? Everything else printable with uname is shown. I am not looking into fixing this. Even the manual page of uname says that it's a common output.

I just want to know why.

10

POSIX doesn't define -p or -i. In GNU coreutils they are marked as non-portable, as you indicate; the default implementation relies on two optional operating system features, the three-argument form of sysinfo(2) (from SunOS) and the six-argument form of sysctl(3) (from the BSDs; neither of which are available on Linux).

Thus on Debian and derived distributions (apart from Ubuntu and its derivatives), you simply get unknown.

On Fedora and related distributions, uname is patched to return the machine type (-m) as processor (-p) and hardware platform (-i), with the latter tweaked to produce i386 for any value of the form i?86.

On Ubuntu and derivatives, a variant of the Fedora patch is used, which additionally checks for AMD CPUs on i686 processors and produces athlon instead.

  • Thanks! And I guess they didn't remove the options to not build a difference in usage between distros. – Junaga Sep 5 '16 at 11:46
  • 1
    Yes — if you're running GNU coreutils' uname, the options are always there (well, since they were introduced, I didn't check when that happened), but they might not return anything useful. – Stephen Kitt Sep 5 '16 at 11:54
  • FWIW Ubuntu includes the Fedora patch. – drewbenn Aug 7 '17 at 18:43
2

Read the info page, it is more detailed:

‘-i’

‘--hardware-platform’

 Print the hardware platform name (sometimes called the hardware
 implementation).  Print ‘unknown’ if the kernel does not make this
 information easily available, as is the case with Linux kernels.

‘-p’

‘--processor’

 Print the processor type (sometimes called the instruction set
 architecture or ISA). Print ‘unknown’ if the kernel does not make
 this information easily available, as is the case with Linux
 kernels.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.