linux 下查看cpu位数 内核等参数命令(转)
1 # uname -a 2 3 Linux euis1 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux 4 5 (查看当前操作系统内核信息) 6 7 8 9 10 # cat /etc/issue | grep Linux 11 12 Red Hat Enterprise Linux AS release 4 (Nahant Update 5) 13 14 (查看当前操作系统发行版信息) 15 16 17 18 19 # cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 20 21 8 Intel(R) Xeon(R) CPU E5410 @ 2.33GHz 22 23 (看到有8个逻辑CPU, 也知道了CPU型号) 24 25 26 # cat /proc/cpuinfo | grep physical | uniq -c 27 28 4 physical id : 0 29 30 4 physical id : 1 31 32 (说明实际上是两颗4核的CPU) 33 34 35 # getconf LONG_BIT 36 37 32 38 39 (说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit) 40 41 42 # cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l 43 44 8 45 46 (结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit) 47 48 ======================================== 49 50 51 52 查看linux系统版本,位数的相关命令 53 54 55 56 1.查看内核版本 57 58 [oracle@svr15 ~]$ cat /etc/issue 59 Red Hat Enterprise Linux AS release 4 (Nahant) 60 Kernel /r on an /m 61 62 [oracle@svr15 ~]$ cat /proc/version 63 Linux version 2.6.9-5.ELsmp (bhcompile@decompose.build.redhat.com) (gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)) #1 SMP Wed Jan 5 19:30:39 EST 2005 64 65 [oracle@svr15 ~]$ uname -r 66 2.6.9-5.ELsmp 67 68 69 70 2.查看操作系统位数 71 [oracle@svr15 ~]$ ls / #如果有lib64或这个目录,那操作系统就是64位的 72 bin boot dev etc home initrd lib lost+found media misc mnt opt proc root sbin selinux srv sys tmp usr var 73 74 [oracle@svr15 ~]$ getconf LONG_BIT 75 32