Linux information about computer

Получение информации о компьютере на UNIX

Обновлено

Обновлено: 23.06.2023 Опубликовано: 19.06.2018

В данной статье пойдет речь о способах сбора сведений об оборудовании компьютера, который находится под управлением операционных систем семейства UNIX, такие как Linux и BSD. Также, будет немного затронута тема получения системной информации и замера скорости и активности. Действия будут выполняться из командной строки без графической оболочки — их можно выполнить, подключившись к компьютеру удаленно по SSH.

Информация о процессоре

1. lscpu (Linux)

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 2
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 62
Model name: Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
Stepping: 4
CPU MHz: 2592.918
BogoMIPS: 5187.50
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 20480K
NUMA node0 CPU(s): 0-7

  • Architecture — архитектура процессора — 32 бит или 64.
  • Core(s) per socket — количество ядер на процессор.
  • Socket(s) — количество физических/виртуальных процессоров.
  • CPU(s) — суммарное количество процессорных ядер.
  • Model name — модель процессора.

2. sysctl -a (FreeBSD)

Команда отображает множество данных, поэтому добавляем фильтр:

sysctl -a | egrep -i ‘hw.machine|hw.model|hw.ncpu’

hw.model: Intel(R) Xeon(R) CPU X5690 @ 3.47GHz
hw.machine: amd64
hw.ncpu: 2

* на самом деле, команда sysctl работает и в Linux, но формат вывода менее удобен, по сравнению с вышерассмотренной lscpu.

3. Файл /proc/cpuinfo (Linux)

Позволяет увидеть подробную информацию по каждому ядру:

Команда для подсчета количества ядер:

cat /proc/cpuinfo | grep processor | wc -l

4. Температура процессора

Linux

Сначала необходимо установить утилиту.

После установки утилиты выполняем:

FreeBSD

Загружаем необходимый модуль:

* для автоматической его загрузки добавляем в файл /boot/loader.conf строку coretemp_load=»YES»

sysctl -a | grep temperature

Читайте также:  Linux mint зависает при выключении

dev.cpu.0.temperature: 40.0C
dev.cpu.1.temperature: 41.0C

Информация об оперативной памяти

1. Файл /proc/meminfo (Linux)

MemTotal: 8010284 kB
MemFree: 1058580 kB
MemAvailable: 2791616 kB
Buffers: 1884 kB
Cached: 1754092 kB
SwapCached: 122280 kB
Active: 4330296 kB
Inactive: 2006792 kB
Active(anon): 3623768 kB
Inactive(anon): 983120 kB
Active(file): 706528 kB
Inactive(file): 1023672 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 1048572 kB
SwapFree: 597684 kB
Dirty: 20 kB
Writeback: 0 kB
AnonPages: 4466532 kB
Mapped: 92808 kB
Shmem: 25776 kB
Slab: 408732 kB
SReclaimable: 308820 kB
SUnreclaim: 99912 kB
KernelStack: 7312 kB
PageTables: 23276 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 5053712 kB
Committed_AS: 3770324 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 159328 kB
VmallocChunk: 34359341052 kB
HardwareCorrupted: 0 kB
AnonHugePages: 3248128 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 257984 kB
DirectMap2M: 8130560 kB

  • MemTotal — общий объем оперативной памяти.
  • MemFree — объем памяти, который не используется системой.
  • Buffers — память, которая в данным момент ожидает записи на диск.
  • Cached — объем, задействованный под кэш чтения с диска.
  • MemAvailable — объем памяти, доступной в распределители без необходимости обмена.
  • SwapTotal — объем файла подкачки.
  • SwapFree — свободный объем файла подкачки.

* Объем используемой памяти = MemTotal – MemFree — Cached — Buffers.

Для перевода килобайт в гигабайты можно воспользоваться онлайн калькулятором.

2. free (Linux)

Данная команда позволяет получить информацию об использовании памяти в удобной таблице. Для еще большего удобства, мы выведем ее с помощью дополнительного параметра -h:

total used free shared buff/cache available
Mem: 3,7G 568M 378M 193M 2,8G 2,6G
Swap: 4,0G 94M 3,9G

Источник

Get Linux System and Hardware Details on the Command Line

Sysinfo Linux - Get Linux System Information

Get Linux System Information

If you are using Linux, you may need to know details about the system or the hardware specifications you are using. As a regular Linux user or software developer, it is important that you check the compatibility of any software or hardware system that you want to install. The Linux command line contains several built-in commands that help you become familiar with the software and hardware platform you are working on. This tutorial will teach you how to use these commands to get the sysinfo Linux details.

The commands and examples to get hardware specs from Linux in this tutorial have been tested on Ubuntu 22.04 and Debian 11.

Displaying Basic System Information on Linux Shell

To know the basic information about your system, you need to be familiar with the command-line utility called uname-short for unix name.

Читайте также:  Execute ssh command linux

The uname Command

The uname command comes with multiple switches. The basic command as described below only returns the Kernel name:

Result of uname command

As you can see, the uname command when used without any switches only returns the kernel name i.e., Linux for my system.

Get the Linux Kernel Name

When you precisely want the command to print the kernel name, you will use the following command:

Kernel name displayed with uname command

The above output has displayed Linux as my kernel name.

Get the Linux Kernel Release

In order to print the release information of your kernel, use the following command:

Get Linux Kernel release information

The above command has displayed the release number of my Linux

Get the Linux Kernel Version

To fetch the version of your kernel, use the following command:

Linux Kernel version

The above output shows the version number of my kernel.

Get Network Node Hostname

You can use the following command to print the network hostname of your node:

You can also use the following command for the same purpose as it is more user-friendly:

Get system hostname

Both commands will display the same output. Please note that the host and node names might not be the same for non-Linux systems.

Get Machine Hardware Architecture (i386, x86_64, sysinfo Linux)

In order to know the hardware architecture of the system you are working on, please use the following command:

Get Linux architecture x86_64

The output x86_64 signifies that I am using a 64-bit architecture. The output i686 means that a user is on a 32-bit system.

Get Processor Type

To know the type of processor you are using, please use the following command:

Get Linux processor type

This output shows that I am using a 64-bit processor.

Get Hardware Platform

To know the hardware platform you are using, please use the following command:

Get hardware platform information

In my case, the output is the same as that of the machine hardware name.

Get Operating System information

The following command will let you know the name of the operating system you are using:

Linux Operating System information

My Ubuntu machine has displayed the above output for my system.

Displaying All Information of Uname Command

The above commands have displayed system information as per the type of switch used. In case you want to see all the system information at once, use the following command:

uname -a result

You can see that the above output shows the complete list of system information for the user.

Displaying Detailed Hardware Information

Here we will describe the commands, other than uname, that are used to extract detailed hardware information of your system:

Читайте также:  Linux web server files

Get Hardware Information with lshw

The lshw utility lets you fetch important hardware information, such as memory, CPU, disks, etc., from your system. Please run the following command as a super user to view this information:

Linux get computer model

The above output is a very detailed version of the hardware information of my system. You can also view a summary to list only specific hardware components of hardware information as described in the following section.

Short Summary

In order to view the summary of your detailed hardware profile, please use the following command:

Short summary of lshw hardware report to Linux find hardware info

The above output is a column-wise summary of the hardware profile which is more readable.

Creating an HTML File

The lshw utility also lets you print detailed information of your hardware profile and hardware components to an HTML file as a superuser. Use the following command for this purpose:

$ sudo lshw -html > [filename.html]
$ sudo lshw -html > hardwareinfo.html

Get hardware info Linux

The above HTML file has been created at the /home/user/ folder.

Get CPU Information with lscpu

The lscpu utility lists detailed CPU information like cpu and processing units from the files sysfs and /proc/cpuinfo to your screen. This is how you can use this command:

CPU details shown with lscpu

The above output displays CPU architecture, number of CPUs, cores, CPU family model, threads, CPU caches and much more.

Get Block Device Information with lsblk

The lsblk utility displays information about all the basic storage devices of your system such as hard drive, its partitions and the flash drives connected to your system.

You can use the following command to view much more detailed information about all the devices:

lsblk result

Get USB Device Information with lsusb

The lsusb command lists information about all the USB controllers and the devices connected to them. Please run the following command:

You can also use the following command to view much detailed information about each USB device.

Details about the USB devices

This output displays all the USB controllers and the attached devices.

Get Information About Other Devices

You can also view information about the following devices of your system:

$ hdparm [devicelocation] e.g. $ hdparm /dev/sda2

After practicing along with this tutorial, you will never fail to retrieve sysinfo about Linux and the underlying hardware of your system. This will help you check the system specifications and whether or not prospective hardware or software is compatible with your system.

About This Site

Vitux.com aims to become a Linux compendium with lots of unique and up to date tutorials.

Latest Tutorials

Источник

Оцените статью
Adblock
detector