Linux: Ottenere informazioni sul sistema

Di Xah Lee. Data: 2012-09-12. Ultimo aggiornamento: 2017-09-17.

Trova la versione del kernel Linux

In un terminale, digitate

uname -a

linux terminal uname 2016-05-10
uname -a

Trova nome e versione della Distro Linux

cat /etc/lsb-release

~ $ cat /etc/lsb-releaseDISTRIB_ID=UbuntuDISTRIB_RELEASE=14.04DISTRIB_CODENAME=trustyDISTRIB_DESCRIPTION="Ubuntu 14.04.4 LTS"

Vedi anche: man lsb_release. “lsb” sta per Linux Standard Base. Alcune distro non lo supportano.

Trova la CPU è a 32 o 64 bit

# show linux is 32 bits or 64 bitsgetconf LONG_BIT

Questo vi dirà se il vostro linux è a 32 o 64 bit.

Quanta RAM installata

# show how much RAM installedcat /proc/meminfo
MemTotal: 5937800 kBMemFree: 3344824 kBBuffers: 579436 kBCached: 1130528 kBSwapCached: 0 kBActive: 1540120 kBInactive: 850112 kBActive(anon): 607436 kBInactive(anon): 79140 kBActive(file): 932684 kBInactive(file): 770972 kBUnevictable: 0 kBMlocked: 0 kBHighTotal: 5115592 kBHighFree: 3278656 kBLowTotal: 822208 kBLowFree: 66168 kBSwapTotal: 6027260 kBSwapFree: 6027260 kBDirty: 72 kBWriteback: 0 kBAnonPages: 680272 kBMapped: 105856 kBShmem: 6304 kBSlab: 149900 kBSReclaimable: 67808 kBSUnreclaim: 82092 kBKernelStack: 3168 kBPageTables: 7636 kBNFS_Unstable: 0 kBBounce: 0 kBWritebackTmp: 0 kBCommitLimit: 8996160 kBCommitted_AS: 2692872 kBVmallocTotal: 122880 kBVmallocUsed: 17248 kBVmallocChunk: 65456 kBHardwareCorrupted: 0 kBAnonHugePages: 0 kBHugePages_Total: 0HugePages_Free: 0HugePages_Rsvd: 0HugePages_Surp: 0Hugepagesize: 2048 kBDirectMap4k: 8184 kBDirectMap2M: 905216 kB

Trova il modello di CPU

2 modi.

  • lscpu
  • cat /proc/cpuinfo

Ecco il risultato di lscpu:

lscpuArchitecture: x86_64CPU op-mode(s): 32-bit, 64-bitByte Order: Little EndianCPU(s): 4On-line CPU(s) list: 0-3Thread(s) per core: 1Core(s) per socket: 4Socket(s): 1NUMA node(s): 1Vendor ID: AuthenticAMDCPU family: 16Model: 5Model name: AMD Athlon(tm) II X4 645 ProcessorStepping: 3CPU MHz: 800.000CPU max MHz: 3100.0000CPU min MHz: 800.0000BogoMIPS: 6199.70Virtualization: AMD-VL1d cache: 64KL1i cache: 64KL2 cache: 512KNUMA node0 CPU(s): 0-3Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save~/web/xahlee_info/linux $
# show CPU infocat /proc/cpuinfo
processor : 0vendor_id : AuthenticAMDcpu family : 16model : 5model name : AMD Athlon(tm) II X4 645 Processorstepping : 3cpu MHz : 3098.061cache size : 512 KBfdiv_bug : nohlt_bug : nof00f_bug : nocoma_bug : nofpu : yesfpu_exception : yescpuid level : 5wp : yesflags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 fxsr_opt 3dnowext 3dnow up extd_apicid pni monitor cr8_legacybogomips : 6196.12clflush size : 64cache_alignment : 64address sizes : 48 bits physical, 48 bits virtualpower management:

Trova modello GPU

Tipo

lspci -v

e cerca VGA o ATI o NVIDIA.

Il comando “lspci” elenca tutti i dispositivi PCI.

Sample output

◆ lspci00:00.0 Host bridge: Advanced Micro Devices RS880 Host Bridge00:01.0 PCI bridge: Advanced Micro Devices RS780/RS880 PCI to PCI bridge (int gfx)00:0a.0 PCI bridge: Advanced Micro Devices RS780/RS880 PCI to PCI bridge (PCIE port 5)00:11.0 SATA controller: Advanced Micro Devices nee ATI SB7x0/SB8x0/SB9x0 SATA Controller 00:12.0 USB controller: Advanced Micro Devices nee ATI SB7x0/SB8x0/SB9x0 USB OHCI0 Controller00:12.1 USB controller: Advanced Micro Devices nee ATI SB7x0 USB OHCI1 Controller00:12.2 USB controller: Advanced Micro Devices nee ATI SB7x0/SB8x0/SB9x0 USB EHCI Controller00:13.0 USB controller: Advanced Micro Devices nee ATI SB7x0/SB8x0/SB9x0 USB OHCI0 Controller00:13.1 USB controller: Advanced Micro Devices nee ATI SB7x0 USB OHCI1 Controller00:13.2 USB controller: Advanced Micro Devices nee ATI SB7x0/SB8x0/SB9x0 USB EHCI Controller00:14.0 SMBus: Advanced Micro Devices nee ATI SBx00 SMBus Controller (rev 3c)00:14.2 Audio device: Advanced Micro Devices nee ATI SBx00 Azalia (Intel HDA)00:14.3 ISA bridge: Advanced Micro Devices nee ATI SB7x0/SB8x0/SB9x0 LPC host controller00:14.4 PCI bridge: Advanced Micro Devices nee ATI SBx00 PCI to PCI Bridge00:18.0 Host bridge: Advanced Micro Devices Family 10h Processor HyperTransport Configuration00:18.1 Host bridge: Advanced Micro Devices Family 10h Processor Address Map00:18.2 Host bridge: Advanced Micro Devices Family 10h Processor DRAM Controller00:18.3 Host bridge: Advanced Micro Devices Family 10h Processor Miscellaneous Control00:18.4 Host bridge: Advanced Micro Devices Family 10h Processor Link Control01:05.0 VGA compatible controller: Advanced Micro Devices nee ATI RS880 01:05.1 Audio device: Advanced Micro Devices nee ATI RS880 HDMI Audio 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05)

Dimensione del disco e spazio libero

# show disk size and free spacedf -H

La “-H” è per la lettura umana in unità metriche. (k = 10^3, M = 10^6, G = 10^9.)

df -HFilesystem Size Used Avail Use% Mounted onudev 3.0G 0 3.0G 0% /devtmpfs 600M 9.2M 591M 2% /run/dev/sda5 465G 141G 301G 32% /tmpfs 3.0G 415M 2.6G 14% /dev/shmtmpfs 5.3M 4.1k 5.3M 1% /run/locktmpfs 3.0G 0 3.0G 0% /sys/fs/cgroupcgmfs 103k 0 103k 0% /run/cgmanager/fstmpfs 600M 41k 600M 1% /run/user/1000

Trova i dispositivi USB

# show USB devicesxinput
linux xinput output 2017 04 19

(2012-04-28 grazie a Aaron Coakley)

Se hai una domanda, metti 5 dollari su patreon e mandami un messaggio.