getconf - Query system configuration variables

SYNOPSIS

    getconf -a

    getconf [-v specification] system_var

    getconf [-v specification] path_var pathname


DESCRIPTION

    -a    Display all configuration variables for the current system and their values.

    -v    Indicates the specification and version for which to obtain configuration variables.

    system_var    A system configuration variable,as defined by sysconf or confstr.

    path_var    A system configuration variable as defined by pathconf.This must be used with a pathname.


getconf LONG_BIT can be used to determine if your running kernel is 32 bits or 64bits?

huihoo@huihoo:~$ getconf LONG_BIT
32
huihoo@huihoo:~$
Also,you can type uname -a to deal with this stuff.

huihoo@huihoo:~$ uname -a
Linux huihoo 3.2.0-4-686-pae #1 SMP Debian 3.2.51-1 i686 GNU/Linux
huihoo@huihoo:~$
x86_64 GNU/Linux indicates that you've a 64bit Linux kernel running. If you use see i386/i486/i586/i686 it is a 32 bit kernel.


According to 32 bits kernel can run on 64 bits CPU,but not the other way around.

How can I find out my CPU bits?

huihoo@huihoo:~$ grep flags /proc/cpuinfo | grep --color lm
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 arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm dtherm
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 arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm dtherm
huihoo@huihoo:~$



CPU Modes:

  • lm flag means Long mode cpu - 64 bit CPU
  • Real mode 16 bit CPU
  • Protected Mode is 32-bit CPU


你可能感兴趣的:(getconf - Query system configuration variables)