Меню Рубрики

Command linux info system

Как настроить?

Всё о Интернете, сетях, компьютерах, Windows, iOS и Android

Смотрим информацию о системе в 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 — результат выполнения команды аналогичен предыдущей. Вам будет показана версия дистрибутива ОС.
С помощью этого списка основных команд Вы сможете без проблем посмотреть и узнать основную информацию о ПК и операционной системе.

Источник

16 Commands to Check Hardware Information on Linux

Hardware information

Like for every thing, there are plenty of commands to check information about the hardware of your linux system.

Some commands report only specific hardware components like cpu or memory while the rest cover multiple hardware units.

Читайте также:  Разработка и внедрение системы на встраиваемом linux

This post takes a quick look at some of the most commonly used commands to check information and configuration details about various hardware peripherals and devices.

The list includes lscpu, hwinfo, lshw, dmidecode, lspci etc.

1. lscpu

The lscpu command reports information about the cpu and processing units. It does not have any further options or functionality.

2. lshw – List Hardware

A general purpose utility, that reports detailed and brief information about multiple different hardware units such as cpu, memory, disk, usb controllers, network adapters etc. Lshw extracts the information from different /proc files.

Check out the following post to learn more about lshw

3. hwinfo – Hardware Information

Hwinfo is another general purpose hardware probing utility that can report detailed and brief information about multiple different hardware components, and more than what lshw can report.

4. lspci – List PCI

The lspci command lists out all the pci buses and details about the devices connected to them.
The vga adapter, graphics card, network adapter, usb ports, sata controllers, etc all fall under this category.

Filter out specific device information with grep.

5. lsscsi – List scsi devices

Lists out the scsi/sata devices like hard drives and optical drives.

6. lsusb – List usb buses and device details

This command shows the USB controllers and details about devices connected to them. By default brief information is printed. Use the verbose option “-v” to print detailed information about each usb port

On the above system, 1 usb port is being used by the mouse.

7. Inxi

Inxi is a 10K line mega bash script that fetches hardware details from multiple different sources and commands on the system, and generates a beautiful looking report that non technical users can read easily.

8. lsblk – List block devices

List out information all block devices, which are the hard drive partitions and other storage devices like optical drives and flash drives

9. df – disk space of file systems

Reports various partitions, their mount points and the used and available space on each.

10. Pydf – Python df

An improved df version written in python, that displays colored output that looks better than df

11. fdisk

Fdisk is a utility to modify partitions on hard drives, and can be used to list out the partition information as well.

12. mount

The mount is used to mount/unmount and view mounted file systems.

Again, use grep to filter out only those file systems that you want to see

13. free – Check RAM

Check the amount of used, free and total amount of RAM on system with the free command.

14. dmidecode

The dmidecode command is different from all other commands. It extracts hardware information by reading data from the SMBOIS data structures (also called DMI tables).

Check out the man page for more details.

15. /proc files

Many of the virtual files in the /proc directory contain information about hardware and configurations. Here are some of them

16. hdparm

The hdparm command gets information about sata devices like hard disks.

Summary

Each of the command has a slightly different method of extracting information, and you may need to try more than one of them, while looking for specific hardware details. However they are available across most linux distros, and can be easily installed from the default repositories.

Читайте также:  Linux библия пользователя кристофер негус

On the desktop there are gui tools, for those who do not want to memorise and type commands. Hardinfo, I-nex are some of the popular ones that provide detailed information about multiple different hardware components.

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected] .

44 thoughts on “ 16 Commands to Check Hardware Information on Linux ”

Thank you! Your descriptions were useful and well explained!

Источник

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.

The commands and examples mentioned in this tutorial have been tested on Ubuntu 18.04 LTS 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: Advertisement Advertisement

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 above 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, etc.)

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:

Читайте также:  Как установить linux mint на vmware workstation

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 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 information about the 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

Источник

Популярные записи

Minecraft запуск сервера linux
Centos linux 6 kvm
Принудительно завершить процесс linux
Linux mail delete all messages
В чем плюсы linux
Gui avrdude для linux
Adblock
detector