티스토리 뷰
linux 하드웨어 사양을 알아보는 명령어
CPU 정보
[root@shuiky webapps]# cat /proc/cpuinfo | more processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 42 model name : Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz stepping : 7 cpu MHz : 1600.000 cache size : 8192 KB . . 중략 . .
메모리 정보
[root@shuikywebapps]# cat /proc/meminfo MemTotal: 8034300 kB MemFree: 1418372 kB Buffers: 56192 kB Cached: 3887776 kB SwapCached: 540 kB Active: 3662244 kB Inactive: 2511660 kB Active(anon): 1720468 kB Inactive(anon): 510020 kB Active(file): 1941776 kB Inactive(file): 2001640 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 10272760 kB SwapFree: 10265688 kB Dirty: 112 kB Writeback: 0 kB AnonPages: 2229428 kB Mapped: 71780 kB Shmem: 544 kB Slab: 293120 kB SReclaimable: 250216 kB SUnreclaim: 42904 kB KernelStack: 6864 kB PageTables: 24028 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 14289908 kB Committed_AS: 5259772 kB VmallocTotal: 34359738367 kB VmallocUsed: 142868 kB VmallocChunk: 34359581796 kB HardwareCorrupted: 0 kB AnonHugePages: 2025472 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 6144 kB DirectMap2M: 8366080 kB
CPU가 32비트인지 64비트 확인
[root@shuiky webapps]# cat /proc/cpuinfo | grep flags | grep lm
audio, video, disk controller 등 기타 하드웨어 확인(-t 옵션은 그룹으로 표시, -v 옵션은 상세 표시)
[root@shuiky webapps]# lspci -tv
그래픽카드 확인
[root@shuiky webapps]# lspci | grep VGA
연결된 USB 장비 확인
[root@shuiky webapps]# lsusb
하드디스크 크기 및 사용하고 있는 드라이브 확인(USB 드라이브, stick 포함)
[root@shuiky webapps]# fdisk -l | grep GB
특정 하드디스크 정보(제조사, 모델명 등) 확인
[root@shuiky webapps]# hdparm -i /dev/sda /dev/sda: Model=Hitachi, FwRev=MKAOA5C0, SerialNo=MK0311YHGJ9V2A Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs } RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=56 BuffType=DualPortCache, BuffSize=unknown, MaxMultSect=16, MultSect=16 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=5860533168 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120} PIO modes: pio0 pio1 pio2 pio3 pio4 DMA modes: mdma0 mdma1 mdma2 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6 AdvancedPM=yes: disabled (255) WriteCache=enabled Drive conforms to: unknown: ATA/ATAPI-2,3,4,5,6,7 * signifies the current active mode
현재 하드 드라이브의 파티션과 파일 시스템 등을 자세히 보기
[root@shuiky webapps]# fdisk -l
현재 로드된 모듈 확인
[root@shuiky webapps]# lsmod
특정 모듈 정보 확인
[root@shuiky webapps]# modinfo 모듈명
모듈 제거 하기
[root@shuiky webapps]# modprobe -remove 모듈명
커널에 모듈 로드 하기
[root@shuiky webapps]# modprobe 모듈명
하드웨어에서 사용하는 모듈 확인
[root@shuiky webapps]# lspci -v [root@shuiky webapps]# lspci -vvv
PCMCIA 카드 확인
[root@shuiky webapps]# lspcmcia
스왑 메모리가 포함된 램 용량 및 사용 상태 확인
[root@shuiky webapps]# free -m [root@shuiky webapps]# free -g
사운드 카드 확인
[root@shuiky webapps]# cat /dev/sndstat
무선 랜카드 확인
[root@shuiky webapps]# iwconfig
컴퓨터 DMI(=SMBIOS) 테이블 정보를 확인
[root@shuiky webapps]# dmidecode | more
CPU, AC Adapter, Battery 등은 /proc/acpi 디렉토리 참조
설치된 Linux 종류 확인
[root@shuiky webapps]# cat /etc/issue CentOS release 6.2 (Final) [root@shuiky webapps]# cat /proc/version Linux version 2.6.32-220.13.1.el6.x86_64 (mockbuild@c6b6.bsys.dev.centos.org) (gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) ) #1 SMP Tue Apr 17 23:56:34 BST 2012 [root@shuiky webapps]# dmesg | head -1 Initializing cgroup subsys cpuset
재시작 이력(last reboot) 정보
[root@shuiky webapps]# last reboot reboot system boot 2.6.32-220.13.1. Fri Jul 20 19:06 - 11:17 (180+16:11) reboot system boot 2.6.32-220.13.1. Wed Jul 18 19:24 - 19:04 (1+23:40) reboot system boot 2.6.32-220.13.1. Wed Jul 18 19:08 - 19:23 (00:14) reboot system boot 2.6.32-220.13.1. Mon Jul 9 11:47 - 19:07 (9+07:19) reboot system boot 2.6.32-220.13.1. Thu Jul 5 10:40 - 10:47 (00:07) reboot system boot 2.6.32-220.13.1. Thu Jul 5 10:29 - 10:38 (00:08) reboot system boot 2.6.32-220.13.1. Wed Jul 4 18:04 - 10:10 (16:06) reboot system boot 2.6.32-220.13.1. Wed Jul 4 11:42 - 12:22 (00:40) reboot system boot 2.6.32-220.13.1. Wed Jul 4 11:40 - 11:40 (00:00) reboot system boot 2.6.32-71.29.1.e Fri May 11 17:45 - 11:40 (53+17:55) reboot system boot 2.6.32-71.29.1.e Mon Apr 23 10:20 - 17:44 (18+07:24) reboot system boot 2.6.32-71.29.1.e Mon Apr 23 10:13 - 10:16 (00:02) reboot system boot 2.6.32-71.29.1.e Wed Dec 28 09:57 - 10:12 (117+00:15) reboot system boot 2.6.32-71.29.1.e Mon Dec 19 09:52 - 09:51 (8+23:59) reboot system boot 2.6.32-71.29.1.e Thu Dec 15 18:00 - 09:51 (12+15:51) reboot system boot 2.6.32-71.29.1.e Mon Oct 24 23:47 - 17:46 (51+17:58) reboot system boot 2.6.32-71.el6.x8 Mon Oct 24 17:43 - 23:46 (06:03)
To open any file from command line using the default application (will launch the correct graphical application for the file, as though you had doubled-clicked the file graphically):
[root@shuiky webapps]# xdg-open ./filename
네트워크 연결 실시간 모니터링
[root@shuiky webapps]# watch -n.1 `netstat -tup`
현재 시스템(Linux Kernel) 정보
[root@shuiky webapps]# uname -a Linux shuiky 2.6.32-220.13.1.el6.x86_64 #1 SMP Tue Apr 17 23:56:34 BST 2012 x86_64 x86_64 x86_64 GNU/Linux
참고
Easily find your hardware specifications (and some system monitoring commands) in Linux
20 Linux System Monitoring Tools Every SysAdmin Should Know
HowTo: Find Out Hard Disk Specs / Details on Linux