링크 ux 에서 cpu 비트 커 널 등 매개 변수 명령 보기


링크 ux 에서 cpu 비트 커 널 등 매개 변수 명령 보기 
 
# uname -a
Linux euis1 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux
(현재 운영 체제 커 널 정보 보기)
# cat /etc/issue 
Red Hat Enterprise Linux AS release 4 (Nahant Update 5)
(현재 운영 체제 발행 판 정보 보기)
Ubuntu 아래:
1) cat /etc/issueUbuntu 12.04.2 LTS \l
2) lsb_release -aNo LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu 12.04.2 LTSRelease: 12.04Codename: precise
# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
      8  Intel(R) Xeon(R) CPU            E5410   @ 2.33GHz
(8 개의 논리 CPU 가 있 는 것 을 보고 CPU 모델 도 알 게 되 었 다)
# cat /proc/cpuinfo | grep physical | uniq -c
      4 physical id      : 0
      4 physical id      : 1
(실제로는 4 핵 CPU 두 개 라 는 뜻)
# getconf LONG_BIT
32
(현재 CPU 가 32bit 모드 에서 실행 되 고 있 지만 CPU 가 64bit 를 지원 하지 않 는 것 은 아 닙 니 다)
# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
8
(결과 가 0 이상 이면 64bit 계산 을 지원 한 다 는 뜻 입 니 다. lm 는 long mode 를 말 하고 lm 는 64bit 를 지원 합 니 다)
 
 
========================================
 
Liux 시스템 버 전, 커 널, CPU, MEM, 자릿수 관련 명령 보기
 
1. 버 전 보기, 커 널 [oracle@svr15 ~]$ cat /etc/issueRed Hat Enterprise Linux AS release 4 (Nahant)Kernel /r on an /m [oracle@svr15 ~]$ cat /proc/versionLinux version 2.6.9-5.ELsmp ([email protected]) (gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)) #1 SMP Wed Jan 5 19:30:39 EST 2005[oracle@svr15~] $uname - r2.6.9 - 5. ELsmp 2. cpu 보기, mem [oracle@svr15 ~]$ grep "model name" /proc/cpuinfomodel name      : Intel(R) Xeon(R) CPU            5130 @ 2.00GHzmodel name      : Intel(R) Xeon(R) CPU            5130 @ 2.00GHzmodel name      : Intel(R) Xeon(R) CPU            5130 @ 2.00GHzmodel name      : Intel(R) Xeon(R) CPU            5130 @ 2.00GHz[oracle@svr15 ~]$ cat /proc/cpuinfoprocessor       : 0vendor_id       : GenuineIntelcpu family      : 6model           : 15model name      : Intel(R) Xeon(R) CPU            5130 @ 2.00GHzstepping        : 6cpu MHz         : 1995.006cache size      : 64 KBphysical id     : 0siblings        : 2fdiv_bug        : nohlt_bug         : nof00f_bug        : nocoma_bug        : nofpu             : yesfpu_exception   : yescpuid level     : 10wp              : yesflags           : 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 pni monitor ds_cpl tm2 xtprbogomips        : 3956.73processor       : 1vendor_id       : GenuineIntelcpu family      : 6model           : 15model name      : Intel(R) Xeon(R) CPU            5130 @ 2.00GHzstepping        : 6cpu MHz         : 1995.006cache size      : 64 KBphysical id     : 0siblings        : 2fdiv_bug        : nohlt_bug         : nof00f_bug        : nocoma_bug        : nofpu             : yesfpu_exception   : yescpuid level     : 10wp              : yesflags           : 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 pni monitor ds_cpl tm2 xtprbogomips        : 3981.313. 운영 체제 자릿수 보기 [oracle@svr15 ~]$ ls /   #lib 64 또는 이 디 렉 터 리 가 있다 면 운영 체 제 는 64 비트 bin boot dev etc home initrd lib lost + found media misc mnt opt proc root sbin selinux srv sys tmp usr var [oracle@svr15 ~]$ getconf LONG_BIT32[oracle@svr15 ~]$ ldd /sbin/mii-tool        libc.so.6 => /lib/i686/libc.so.6 (0x00b2f000)        /lib/ld-linux.so.2 (0x00a49000)
 
셸 스 크 립 트 통계
셸 스 크 립 트 를 통 해 Liux 시스템 이름, 기계 자릿수, cpu, 커 널 수, 메모리 등 정 보 를 얻 을 수 있 습 니 다.
#!/bin/bash

hostname=`hostname`

ip_addr=`ifconfig | grep inet | grep Bcast | tr -s " "`

os_name=`cat /etc/issue | head -n1`

os_bit=`getconf LONG_BIT`

cpu=`cat /proc/cpuinfo | grep name | cut -f2 -d: | head -n1`

cpu_core=`cat /proc/cpuinfo | grep name | cut -f2 -d: | wc -l`

memory_kb=`cat /proc/meminfo | grep MemTotal | awk '{print $(NF-1)}'`
memory_mb=`expr $memory_kb / 1024`
memory_gb=`expr $memory_mb / 1024`
memory="$memory_gb GB; $memory_mb MB; $memory_kb KB"


memory_cmd='free -m'


echo "hostname : $hostname"

echo "ip_addr : $ip_addr"
echo

echo "os_name : $os_name"

echo "os_bit : $os_bit bit"

echo "cpu : $cpu"

echo "cpu_core : $cpu_core"
echo

echo "memory : $memory"

$memory_cmd

실행 결과 (ubuntu):
homer@ubuntu:~/Desktop$ ./sysconfig.sh  hostname : ubuntuip_addr :  inet addr:172.27.22.21 Bcast:172.27.22.255 Mask:255.255.255.0os_name : Ubuntu 12.04.2 LTS \los_bit : 64 bitcpu :  Intel(R) Core(TM) i7-3770K CPU @ 3.50GHzcpu_core : 4memory : 5 GB; 5967 MB; 6110792 KB             total       used       free     shared    buffers     cachedMem:          5967       5788        178          0        207       1903-/+ buffers/cache:       3677       2289Swap:         4092          0       4092
주의: 이 스 크 립 트 는 Ubuntu, CentOS, Redhat 에서 유 니 버 설 테스트 를 합 니 다.

좋은 웹페이지 즐겨찾기