웹사이트 검색

Linux에서 시스템 및 하드웨어 정보를 수집하는 10가지 명령


실행 중인 Linux 시스템의 하드웨어 구성 요소를 아는 것은 항상 좋은 습관입니다. 이는 yum, dnf 또는 apt를 사용하여 시스템에 패키지 및 드라이버를 설치할 때 호환성 문제를 처리하는 데 도움이 됩니다.

이 기사에서는 Linux 시스템 및 하드웨어 구성 요소에 대한 정보를 추출하는 데 도움이 되는 몇 가지 유용한 Linux 명령을 살펴보겠습니다.

1. Linux 시스템 정보를 보는 방법

시스템 이름만 알고 싶다면 시스템 정보를 인쇄하는 스위치 없이 uname 명령을 사용하거나 uname -s 명령을 사용하여 시스템의 커널 이름을 인쇄할 수 있습니다.

tecmint@tecmint ~ $ uname

Linux

Linux 네트워크 호스트 이름을 보려면 표시된 대로 uname 명령과 함께 '-n' 스위치를 사용하십시오.

tecmint@tecmint ~ $ uname -n

linux-console.net

Linux 커널 버전에 대한 정보를 얻으려면 '-v' 스위치를 사용하십시오.

tecmint@tecmint ~ $ uname -v

#64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014

Linux 커널 릴리스에 대한 정보를 얻으려면 '-r' 스위치를 사용하십시오.

tecmint@tecmint ~ $ uname -r

3.13.0-37-generic

Linux 하드웨어 아키텍처 이름을 인쇄하려면 '-m' 스위치를 사용하세요.

tecmint@tecmint ~ $ uname -m

x86_64

이 모든 정보는 아래와 같이 'uname -a' 명령을 실행하여 한 번에 인쇄할 수 있습니다.

tecmint@tecmint ~ $ uname -a

Linux linux-console.net 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38
UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

2. Linux 시스템 하드웨어 정보를 보는 방법

여기에서 lshw 도구를 사용하여 CPU, 디스크, 메모리와 같은 하드웨어 구성 요소에 대한 방대한 정보를 수집할 수 있습니다. , USB 컨트롤러

lshw는 상대적으로 작은 도구이며 정보를 추출하는 동안 사용할 수 있는 몇 가지 옵션이 있습니다. lshw에서 제공하는 정보는 다양한 /proc 파일에서 수집되었습니다.

참고: lshw 명령은 수퍼유저(root) 또는 sudo 사용자가 실행한다는 점을 기억하세요.

Linux 시스템 하드웨어에 대한 정보를 인쇄하려면 다음 명령을 실행하십시오.

tecmint@tecmint ~ $ sudo lshw

linux-console.net               
    description: Notebook
    product: 20354 (LENOVO_MT_20354_BU_idea_FM_Lenovo Z50-70)
    vendor: LENOVO
    version: Lenovo Z50-70
    serial: 1037407803441
    width: 64 bits
    capabilities: smbios-2.7 dmi-2.7 vsyscall32
    configuration: administrator_password=disabled boot=normal 
    chassis=notebook family=IDEAPAD frontpanel_password=disabled 
    keyboard_password=disabled power-on_password=disabled 
    sku=LENOVO_MT_20354_BU_idea_FM_Lenovo Z50-70 
    uuid=E4B1D229-D237-E411-9F6E-28D244EBBD98
  *-core
       description: Motherboard
       product: Lancer 5A5
       vendor: LENOVO
       physical id: 0
       version: 31900059WIN
       serial: YB06377069
       slot: Type2 - Board Chassis Location
     *-firmware
          description: BIOS
          vendor: LENOVO
          physical id: 0
          version: 9BCN26WW
          date: 07/31/2014
          size: 128KiB
          capacity: 4032KiB
          capabilities: pci upgrade shadowing cdboot bootselect edd  
          int13floppytoshiba int13floppy360 int13floppy1200 int13floppy720 
int13floppy2880 int9keyboard int10video acpi usb biosbootspecification uefi
......

-short 옵션을 사용하여 하드웨어 정보 요약을 인쇄할 수 있습니다.

tecmint@tecmint ~ $ sudo lshw -short

H/W path       Device      Class          Description
=====================================================
                           system         20354 (LENOVO_MT_20354_
                                          BU_idea_FM_Lenovo Z50-70)
/0                         bus            Lancer 5A5
/0/0                       memory         128KiB BIOS
/0/4                       processor      Intel(R) Core(TM) i5-4210U 
                                          CPU @ 1.70GHz
/0/4/b                     memory         32KiB L1 cache
/0/4/c                     memory         256KiB L2 cache
/0/4/d                     memory         3MiB L3 cache
/0/a                       memory         32KiB L1 cache
/0/12                      memory         8GiB System Memory
/0/12/0                    memory         DIMM [empty]
/0/12/1                    memory         DIMM [empty]
/0/12/2                    memory         8GiB SODIMM DDR3 Synchronous 
                                          1600 MHz (0.6 ns)
/0/12/3                    memory         DIMM [empty]
/0/100                     bridge         Haswell-ULT DRAM Controller
/0/100/2                   display        Haswell-ULT Integrated 
                                          Graphics Controller
/0/100/3                   multimedia     Haswell-ULT HD Audio Controller
...

출력을 html 파일로 생성하려면 -html 옵션을 사용할 수 있습니다.

tecmint@tecmint ~ $ sudo lshw -html > lshw.html

3. Linux CPU 정보를 보는 방법

CPU에 대한 정보를 보려면 lscpu 명령을 사용하십시오. 이는 sysfs에서 CPU 수, 코어, CPU 제품군 모델, CPU 캐시, 스레드 등과 같은 CPU 아키텍처에 대한 정보를 표시합니다. >/proc/cpuinfo.

tecmint@tecmint ~ $ lscpu

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    2
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 69
Stepping:              1
CPU MHz:               768.000
BogoMIPS:              4788.72
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K
NUMA node0 CPU(s):     0-3

4. 리눅스 블록 디바이스 정보 수집 방법

블록 장치는 하드 디스크, 플래시 드라이브 등과 같은 저장 장치입니다. lsblk 명령은 다음과 같이 블록 장치에 대한 정보를 보고하는 데 사용됩니다.

tecmint@tecmint ~ $ lsblk

NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda       8:0    0 931.5G  0 disk 
├─sda1    8:1    0  1000M  0 part 
├─sda2    8:2    0   260M  0 part /boot/efi
├─sda3    8:3    0  1000M  0 part 
├─sda4    8:4    0   128M  0 part 
├─sda5    8:5    0 557.1G  0 part 
├─sda6    8:6    0    25G  0 part 
├─sda7    8:7    0  14.7G  0 part 
├─sda8    8:8    0     1M  0 part 
├─sda9    8:9    0 324.5G  0 part /
└─sda10   8:10   0   7.9G  0 part [SWAP]
sr0      11:0    1  1024M  0 rom  

시스템의 모든 블록 장치를 보려면 -a 옵션을 포함하십시오.

tecmint@tecmint ~ $ lsblk -a

NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda       8:0    0 931.5G  0 disk 
├─sda1    8:1    0  1000M  0 part 
├─sda2    8:2    0   260M  0 part /boot/efi
├─sda3    8:3    0  1000M  0 part 
├─sda4    8:4    0   128M  0 part 
├─sda5    8:5    0 557.1G  0 part 
├─sda6    8:6    0    25G  0 part 
├─sda7    8:7    0  14.7G  0 part 
├─sda8    8:8    0     1M  0 part 
├─sda9    8:9    0 324.5G  0 part /
└─sda10   8:10   0   7.9G  0 part [SWAP]
sdb       8:16   1         0 disk 
sr0      11:0    1  1024M  0 rom  
ram0      1:0    0    64M  0 disk 
ram1      1:1    0    64M  0 disk 
ram2      1:2    0    64M  0 disk 
ram3      1:3    0    64M  0 disk 
ram4      1:4    0    64M  0 disk 
ram5      1:5    0    64M  0 disk 
ram6      1:6    0    64M  0 disk 
ram7      1:7    0    64M  0 disk 
ram8      1:8    0    64M  0 disk 
ram9      1:9    0    64M  0 disk 
loop0     7:0    0         0 loop 
loop1     7:1    0         0 loop 
loop2     7:2    0         0 loop 
loop3     7:3    0         0 loop 
loop4     7:4    0         0 loop 
loop5     7:5    0         0 loop 
loop6     7:6    0         0 loop 
loop7     7:7    0         0 loop 
ram10     1:10   0    64M  0 disk 
ram11     1:11   0    64M  0 disk 
ram12     1:12   0    64M  0 disk 
ram13     1:13   0    64M  0 disk 
ram14     1:14   0    64M  0 disk 
ram15     1:15   0    64M  0 disk 

5. Linux에서 USB 컨트롤러를 확인하는 방법

lsusb 명령은 USB 컨트롤러 및 이에 연결된 모든 장치에 대한 정보를 보고하는 데 사용됩니다.

tecmint@tecmint ~ $ lsusb

Bus 001 Device 002: ID 8087:8000 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 005: ID 0bda:b728 Realtek Semiconductor Corp. 
Bus 002 Device 004: ID 5986:0249 Acer, Inc 
Bus 002 Device 003: ID 0bda:0129 Realtek Semiconductor Corp. 
RTS5129 Card Reader Controller
Bus 002 Device 002: ID 045e:00cb Microsoft Corp. 
Basic Optical Mouse v2.0
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 
2.0 root hub

-v 옵션을 사용하여 각 USB 장치에 대한 자세한 정보를 생성할 수 있습니다.

tecmint@tecmint ~ $ lsusb -v

6. Linux에서 PCI 장치를 확인하는 방법

PCI 장치에는 USB 포트, 그래픽 카드, 네트워크 어댑터 등이 포함될 수 있습니다. lspci 도구는 시스템의 모든 PCI 컨트롤러와 이에 연결된 장치에 관한 정보를 생성하는 데 사용됩니다.

PCI 장치에 대한 정보를 인쇄하려면 다음 명령을 실행하십시오.

tecmint@tecmint ~ $ lspci

00:00.0 Host bridge: Intel Corporation Haswell-ULT 
DRAM Controller (rev 0b)
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT 
Integrated Graphics Controller (rev 0b)
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller
(rev 0b)
00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC 
(rev 04)
00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI #0 
(rev 04)
00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio Controller 
(rev 04)
00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 3 
(rev e4)
00:1c.3 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 4 
(rev e4)
00:1c.4 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 5 
(rev e4)
00:1d.0 USB controller: Intel Corporation Lynx Point-LP USB EHCI #1 
(rev 04)
00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller 
(rev 04)
00:1f.2 SATA controller: Intel Corporation Lynx Point-LP SATA Controller 1 
[AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 
PCI Express Gigabit Ethernet Controller (rev 10)
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. 
RTL8723BE PCIe Wireless Network Adapter
03:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 840M] (rev a2)

트리 형식으로 출력을 생성하려면 -t 옵션을 사용하십시오.

tecmint@tecmint ~ $ lspci -t

-[0000:00]-+-00.0
           +-02.0
           +-03.0
           +-14.0
           +-16.0
           +-1b.0
           +-1c.0-[01]----00.0
           +-1c.3-[02]----00.0
           +-1c.4-[03]----00.0
           +-1d.0
           +-1f.0
           +-1f.2
           \-1f.3

연결된 각 장치에 대한 자세한 정보를 생성하려면 -v 옵션을 사용하십시오.

tecmint@tecmint ~ $ lspci -v

00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 0b)
	Subsystem: Lenovo Device 3978
	Flags: bus master, fast devsel, latency 0
	Capabilities: 

00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT 
Integrated Graphics Controller (rev 0b) (prog-if 00 [VGA controller])
	Subsystem: Lenovo Device 380d
	Flags: bus master, fast devsel, latency 0, IRQ 62
	Memory at c3000000 (64-bit, non-prefetchable) [size=4M]
	Memory at d0000000 (64-bit, prefetchable) [size=256M]
	I/O ports at 6000 [size=64]
	Expansion ROM at  [disabled]
	Capabilities: 
	Kernel driver in use: i915
.....

7. Linux에서 SCSI 장치를 확인하는 방법

모든 scsi/sata 장치를 보려면 다음과 같이 lsscsi 명령을 사용하십시오. lsscsi 도구가 설치되어 있지 않은 경우 다음 명령을 실행하여 설치하세요.

sudo apt-get install lsscsi        [on Debian derivatives]
yum install lsscsi                 [On RedHat based systems]
dnf install lsscsi                 [On Fedora 21+ Onwards]

설치 후 다음과 같이 lsscsi 명령을 실행합니다.

tecmint@tecmint ~ $ lsscsi

[0:0:0:0]    disk    ATA      ST1000LM024 HN-M 2BA3  /dev/sda 
[1:0:0:0]    cd/dvd  PLDS     DVD-RW DA8A5SH   RL61  /dev/sr0 
[4:0:0:0]    disk    Generic- xD/SD/M.S.       1.00  /dev/sdb 

장치 크기를 표시하려면 -s 옵션을 사용하세요.

tecmint@tecmint ~ $ lsscsi -s

[0:0:0:0]    disk    ATA      ST1000LM024 HN-M 2BA3  /dev/sda   1.00TB
[1:0:0:0]    cd/dvd  PLDS     DVD-RW DA8A5SH   RL61  /dev/sr0        -
[4:0:0:0]    disk    Generic- xD/SD/M.S.       1.00  /dev/sdb        -

8. Linux에서 SATA 장치를 확인하는 방법

hdparm 유틸리티를 사용하면 다음과 같이 시스템의 SATA 장치에 대한 일부 정보를 찾을 수 있습니다. 아래 예에서는 내 시스템의 하드 디스크인 블록 장치 /dev/sda1를 사용했습니다.

tecmint@tecmint ~ $ sudo hdparm /dev/sda1

/dev/sda1:
 multcount     =  0 (off)
 IO_support    =  1 (32-bit)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 56065/255/63, sectors = 2048000, start = 2048

실린더, 헤드, 섹터, 크기 및 장치의 시작 오프셋 측면에서 장치 기하학에 대한 정보를 인쇄하려면 -g 옵션을 사용하십시오.

tecmint@tecmint ~ $ sudo hdparm -g /dev/sda1

/dev/sda1:
 geometry      = 56065/255/63, sectors = 2048000, start = 2048

9. 리눅스 파일 시스템 정보를 확인하는 방법

파일 시스템 파티션에 대한 정보를 수집하려면 fdisk 명령을 사용할 수 있습니다. fdisk 명령의 주요 기능은 파일 시스템 파티션을 수정하는 것이지만 파일 시스템의 다른 파티션에 대한 정보를 보는 데에도 사용할 수 있습니다.

다음과 같이 파티션 정보를 인쇄할 수 있습니다. 수퍼유저로 명령을 실행해야 합니다. 그렇지 않으면 출력이 표시되지 않을 수 있습니다.

tecmint@tecmint ~ $ sudo fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! 
The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, 
total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xcee8ad92

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  1953525167   976762583+  ee  GPT
Partition 1 does not start on physical sector boundary.

10. Linux 하드웨어 구성 요소 정보를 확인하는 방법

dmidecode 유틸리티를 사용하여 DMI 테이블에서 데이터를 읽어 하드웨어 정보를 추출할 수도 있습니다.

Linux 메모리에 대한 정보를 인쇄하려면 수퍼유저로 이 명령을 실행하세요.

tecmint@tecmint ~ $ sudo dmidecode -t memory

dmidecode 2.12
SMBIOS entry point at 0xaaebef98
SMBIOS 2.7 present.

Handle 0x0005, DMI type 5, 24 bytes
Memory Controller Information
	Error Detecting Method: None
	Error Correcting Capabilities:
		None
	Supported Interleave: One-way Interleave
	Current Interleave: One-way Interleave
	Maximum Memory Module Size: 8192 MB
	Maximum Total Memory Size: 32768 MB
	Supported Speeds:
		Other
	Supported Memory Types:
		Other
	Memory Module Voltage: Unknown
	Associated Memory Slots: 4
		0x0006
		0x0007
		0x0008
		0x0009
	Enabled Error Correcting Capabilities:
		None
...

시스템에 대한 정보를 인쇄하려면 이 명령을 실행하십시오.

tecmint@tecmint ~ $ sudo dmidecode -t system

dmidecode 2.12
SMBIOS entry point at 0xaaebef98
SMBIOS 2.7 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: LENOVO
	Product Name: 20354
	Version: Lenovo Z50-70
	Serial Number: 1037407803441
	UUID: 29D2B1E4-37D2-11E4-9F6E-28D244EBBD98
	Wake-up Type: Power Switch
	SKU Number: LENOVO_MT_20354_BU_idea_FM_Lenovo Z50-70
	Family: IDEAPAD
...

Linux BIOS에 대한 정보를 인쇄하려면 이 명령을 실행하세요.

tecmint@tecmint ~ $ sudo dmidecode -t bios

dmidecode 2.12
SMBIOS entry point at 0xaaebef98
SMBIOS 2.7 present.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
	Vendor: LENOVO
	Version: 9BCN26WW
	Release Date: 07/31/2014
	Address: 0xE0000
	Runtime Size: 128 kB
	ROM Size: 4096 kB
	Characteristics:
		PCI is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		Boot from CD is supported
		Selectable boot is supported
		EDD is supported
		Japanese floppy for NEC 9800 1.2 MB is supported (int 13h)
		Japanese floppy for Toshiba 1.2 MB is supported (int 13h)
		5.25"/360 kB floppy services are supported (int 13h)
		5.25"/1.2 MB floppy services are supported (int 13h)
		3.5"/720 kB floppy services are supported (int 13h)
		3.5"/2.88 MB floppy services are supported (int 13h)
		8042 keyboard services are supported (int 9h)
		CGA/mono video services are supported (int 10h)
		ACPI is supported
		USB legacy is supported
		BIOS boot specification is supported
		Targeted content distribution is supported
		UEFI is supported
	BIOS Revision: 0.26
	Firmware Revision: 0.26
...

Linux 프로세서에 대한 정보를 인쇄하려면 이 명령을 실행하세요.

tecmint@tecmint ~ $ sudo dmidecode -t processor

dmidecode 2.12
SMBIOS entry point at 0xaaebef98
SMBIOS 2.7 present.

Handle 0x0004, DMI type 4, 42 bytes
Processor Information
	Socket Designation: U3E1
	Type: Central Processor
	Family: Core i5
	Manufacturer: Intel(R) Corporation
	ID: 51 06 04 00 FF FB EB BF
	Signature: Type 0, Family 6, Model 69, Stepping 1
	Flags:
...
요약

Linux 시스템 하드웨어 구성 요소에 대한 정보를 얻는 데 사용할 수 있는 다른 방법이 많이 있습니다. 이러한 명령의 대부분은 /proc 디렉토리의 파일을 사용하여 시스템 정보를 추출합니다.

이러한 팁과 요령이 도움이 되기를 바라며, 여기에 더 많은 정보를 추가하고 싶거나 명령을 사용하는 데 어려움이 있는 경우 댓글을 게시하는 것을 잊지 마세요. 항상 Tecmint에 연결되어 있어야 한다는 것을 기억하세요.