Linux command about system

Содержание
  1. Linux Command To Find the System Configuration And Hardware Information
  2. Linux cpu/hardware information
  3. Linux show free and used memory in the system
  4. Find ram speed and max supported ram by the server
  5. Linux find out the current running kernel version
  6. Find out information about the Linux distribution and version
  7. List all PCI devices
  8. List all USB devices
  9. List all block devices (hard disks, cdrom, and others)
  10. Display installed hard disk and size
  11. Display information about hardware RAID
  12. Say hello to lshw
  13. Dump all hardware information
  14. Получение информации о компьютере на UNIX
  15. Информация о процессоре
  16. 1. lscpu (Linux)
  17. 2. sysctl -a (FreeBSD)
  18. 3. Файл /proc/cpuinfo (Linux)
  19. 4. Температура процессора
  20. Linux
  21. FreeBSD
  22. Информация об оперативной памяти
  23. 1. Файл /proc/meminfo (Linux)
  24. 2. free (Linux)
  25. Смотрим информацию о системе в Linux (Ubuntu, CentOS, Fedora)
  26. Get Linux System and Hardware Details on the Command Line
  27. Displaying Basic System Information on Linux Shell
  28. The uname Command
  29. Get the Linux Kernel Name
  30. Get the Linux Kernel Release
  31. Get the Linux Kernel Version
  32. Get Network Node Hostname
  33. Get Machine Hardware Architecture (i386, x86_64, sysinfo Linux)
  34. Get Processor Type
  35. Get Hardware Platform
  36. Get Operating System information
  37. Displaying All Information of Uname Command
  38. Displaying Detailed Hardware Information
  39. Get Hardware Information with lshw
  40. Short Summary
  41. Creating an HTML File
  42. Get CPU Information with lscpu
  43. Get Block Device Information with lsblk
  44. Get USB Device Information with lsusb
  45. Get Information About Other Devices
  46. Karim Buzdar

Linux Command To Find the System Configuration And Hardware Information

W hat is the command to find the system configuration on Linux operating system using command line (text) mode?


On Linux based system most of the hardware information can be extracted from /proc file system, for example display CPU and Memory information, enter:

Tutorial details
Difficulty level Intermediate
Root privileges Yes
Requirements None
Est. reading time 10 minutes

cat /proc/meminfo
cat /proc/cpuinfo

The following list summarizes commands to get various hardware from the system:

Linux cpu/hardware information

Use any one of the following command:
# less /proc/cpuinfo
OR
# lscpu
Sample outputs:

Linux show free and used memory in the system

Use any one of the following command:
# cat /proc/meminfo
OR
# free
# free -m
# free -mt
# free -gt
Sample outputs:

You can also run top/htop/atop commands to see used and free memory and cpu usage and more:
# top
# htop
# atop

Find ram speed and max supported ram by the server

# dmidecode —type 17
# lshw -short -C memory
# perl memconf.v3.06.pl -v
Sample outputs:

Linux find out the current running kernel version

Type the following command:
# cat /proc/version
Sample outputs:

OR use the following command:
# uname -mrs
# uname -a

Find out information about the Linux distribution and version

# lsb_release -a
Sample outputs:

OR use the following command:
$ cat /etc/*release*
Sample outputs:

List all PCI devices

# lspci
Sample outputs:

List all USB devices

# lsusb
Sample outputs:

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

List all block devices (hard disks, cdrom, and others)

# lsblk
Sample outputs:

Display installed hard disk and size

# fdisk -l | grep ‘^Disk /dev/’
Sample outputs:

Display information about hardware RAID

See info about Adaptec hardware RAID:
# arcconf getconfig DEV
# /usr/StorMan/arcconf getconfig 1
See info about 3ware hardware RAID:
# tw_cli /dev show
# tw_cli /c0 show

Say hello to lshw

The lshw is a small command line tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4 is known to work):
# lshw | more
# lshw -html > output.htmlq
# lshw -short | less
Sample outputs:

Dump all hardware information

Type the following command to see your motherboard, cpu, vendor, serial-numbers, RAM, disks, and other information directly from the system BIOS:
# dmidecode | less
Sample outputs:

Источник

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

В данной статье пойдет речь о способах сбора сведений об оборудовании компьютера, который находится под управлением операционных систем семейства 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

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

yum install lm_sensors

apt-get install lm-sensors

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

FreeBSD

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

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

sysctl -a | grep temperature

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

Источник

Смотрим информацию о системе в Linux (Ubuntu, CentOS, Fedora)

Тем кто только-только пересел с операционной системы Windows на более сложный Linux, порой бывает сложно выполнить те операции, которые на знакомой ОС делались за пару секунд.
Одна из подобных задач — посмотреть основную информацию о системе: какой стоит процессор, материнская плата, версия операционной системы, разрядность, ядро и т.п. В старой доброй Windows достаточно было вывести свойства системы или открыть диспетчер задач. А тут всё сложнее. Но вся сила Линукс — в консоли и есть ряд специальных команд командой строки, которые помогут узнать всю необходимую информацию о Вашей ОС Linux, будь то Ubuntu, CentOS, Fedora или иной дистрибутив. Сейчас я Вам их покажу!

hwinfo — эта утилита выдаёт массу информации о комплектующих: процессоре, материнской плате, оперативной памяти, видеокарте, жесткому диску и т.п. К сожалению, не во всех дистрибутивах она присутствует, но установить ещё случай чего — проще простого:
— в Debian, Ubuntu: sudo apt-get install hwinfo
— в Fedora и Red Hat: yum install hwinfo

Чтобы вывести основную информацию, воспользуйтесь ключом —short.

lshw — эта команда выдаёт полную информацию о аппаратной части компьютера или ноутбука.

Конечно, до уровная утилиты hwinfo ещё далеко, но основную информацию получить вполне реально. Команда lshw выполняется с правами рута — sudo lshw.

cat /proc/cpuinfo — вывод полной информации о процессоре, установленном на ПК.

cat /proc/meminfo — подробные данные о полном объёме оперативной памяти, сколько её занято и сколько свободно.

free -m — команда похожа по результату на предыдущую, за тем лишь результатом, что вывод будет в виде небольшой таблицы.

lspci | grep VGA — эта директива отобразит информацию по установленной видеокарте.

lspci | grep Audio — смотрим какая на компьютере установлена звуковая карта.

df -H — подробная информация по разделам жесткого диска, их объём и текущая загрузка.

lspci | grep Ethernet — модель и производитель сетевого адаптера ПК.

uname -a — эта команда отобразит в консоли основные данные по операционной системе Linux — версию ядра, дистрибутива, а так же используемую архитектуру — 32 или 64 бита).

uname -r — выводится информация о версии ядра ОС.

cat /proc/version — вывод команды полностью аналогичен предыдущей.

lsb_release -a — здесь в качестве результата выполнения команды будет название установленного дистибутива Линукс и его версия:

cat /etc/*release* — результат выполнения команды будет во много аналогичным предшествующей директиве. То есть будет показана инфа о дистрибутиве и его версии.

Важное отличие — если Вы используете ОС построенную на каком либо дистрибутиве, то команда отобразить и информацию о базовом дистрибутиве Линукс.

ls -clt / | tail -n 1 | awk ‘< print $7, $6, $8 >’ — эта команда отобразит Вам дату и время установки системы.

ls -dl /var/log/installer/ — эта команда Linux так же позволяет узнать дату и время установки системы.

cat /etc/issue — результат выполнения команды аналогичен предыдущей. Вам будет показана версия дистрибутива ОС.
С помощью этого списка основных команд Вы сможете без проблем посмотреть и узнать основную информацию о ПК и операционной системе.

Источник

Get Linux System and Hardware Details on the Command Line

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

The commands and examples mentioned in this tutorial have been tested on Ubuntu 20.04 and Debian 10.

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.

The uname Command

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

Output:

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:

Output:

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:

Output:

The above command has displayed the release number of my Linux

Get the Linux Kernel Version

In order to fetch the version of your kernel, use the following command:

Output:

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:

Output:

Both commands will display the same output. Please note that the hostname and the node name 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:

Output:

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

In order to know the type of processor you are using, please use the following command:

Output:

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

Get Hardware Platform

In order to know the hardware platform you are using, please use the following command:

Output:

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:

Output:

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:

Output:

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:

Get Hardware Information with lshw

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

Output:

The above output is a very detailed version of the hardware information of my system. You can also view a summary 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:

Output:

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 your hardware profile to an HTML file as a superuser. Use the following command for this purpose:

Output:

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

Get CPU Information with lscpu

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

Output:

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:

Output:

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.

Output:

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:

  • PCI devices

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.

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn

Источник

Читайте также:  Windows stop code windows 10 memory management windows 10
Оцените статью