• Share on Google+

Introduction

A computer consists of physical devices called global hardware, and logical components called software. There are tools that allow identifying both parts, either to know the characteristics of the equipment as to measure their performance and / or to diagnose possible failures.

Don’t forget to read

When there is a need to request support in solving problems, it is important to be able to provide all the information that is possible and necessary about the hardware and software that make up the equipment. In that sense, this article can be seen as an expansion of an older one in which we explained where the system log files are.

Justification

When looking for answers to the problems you may face when using Linux you need to provide all the necessary information about the problem in question, such as: the type of computer you have, Debian version, kernel version, desktop system, etc. This will help describe the steps you took to cause or resolve the problem.

It is easier to request and obtain support when you know how to provide such information, and this article aims to provide a list of commands to achieve that goal. Many new Debian GNU / Linux users do not know how to provide as much information as possible and may not receive adequate help simply because they do not know how to provide the right information.

Conventions

In some commands the resulting information exceeds the height of the screen, so to facilitate reading that information, the less pager is used and in this way it is possible to scroll down and up by displaying all the information. To exit the pager simply press the Q (quit) key. Here are 2 examples of how this pager will be used:

Dmesg | Less

Y

Less /etc/apt/sources.list

Manufacturer and model information

Manufacturer:

Sudo dmidecode -s system-manufacturer

Product name:

Sudo dmidecode -s system-product-name

Product version:

Sudo dmidecode -s system-version

Serial number of the equipment:

Sudo dmidecode -s system-serial-number

SKU (Stock Keeping Unit) or P / N (Part Number) of product:

Sudo dmidecode | Grep -i sku

More detailed information:

Sudo dmidecode

Processor Information

Show manufacturer name, model, and speed:

Grep 'vendor_id' / proc / cpuinfo; Grep 'model name' / proc / cpuinfo; Grep 'cpu MHz' / proc / cpuinfo

Show architecture (32 or 64 bits):

Sudo lshw -C CPU | Grep width
Note: The lshw package is not installed by default, so it is necessary to install it before using it.

Display machine type:

Uname -m

Show if the processor supports “Virtualization Extensions” (Intel-VT or AMD-V), which are activated from the BIOS configuration of the computer:

If the processor is Intel, you need to know if the value “vmx” appears:

Grep -i vmx / proc / cpuinfo

If the processor is AMD, you need to know if the “svm” value appears:

Grep -i svm / proc / cpuinfo

Battery Information

Acpi -bi

or

Acpitool -B
Note: The acpitool command is not installed by default.

RAM memory and SWAP partition

Show total RAM and swap partition (change the last parameter by: -b = Bytes, -k = Kilobytes, -m = Megabytes, -g = Gigabytes, as appropriate):

Free -o -m

And another way to do it is like this:

Grep 'MemTotal' / proc / meminfo; Grep 'SwapTotal' / proc / meminfo

To show in which partition (and size) is the swap:

Sudo swapon -s

Kernel

Display the name and version of the kernel:

Uname s

Shell

Show the shell in use:

Echo shell

Distribution

Show the name, version and key name of the distribution:

Lsb_release -idc

User Environment

Current user name:

Echo $ USER

Name of the team:

Echo $ HOSTNAME

Base directory of the current user:

Echo $ HOME

Current job directory:

Echo $ PWD

or

Pwd

Hardware

List PCI / PCIe Devices

Lspci

List all PCMCIA devices

/ Sbin / lspcmcia

List all USB devices:

Lsusb

List all devices detected as SCSI:

Lsscsi
Note: The above package is not installed by default, so it is necessary to install it before using it.

Modules that have been specified to the kernel that loads during startup:

Cat / etc / modules

List all the modules loaded by the system:

Lsmod | Less

List the hardware (summary information):

Sudo lshw -short

List the hardware (extensive information):

Sudo lshw | Less
Note: The lshw package is not installed by default, so it is necessary to install it before using it.

Storage and boot media

List the partitions on the storage media:

Sudo fdisk -l

Know the space used and available in the partitions:

Df -h

Know which partition (and size) is swap:

Sudo swapon -s

Display the registered entries for the GRUB “Legacy” boot loader (up to version 0.97):

Sudo grep -i title /boot/grub/menu.lst | Grep "#" -v

Show logged entries for the GRUB 2 boot loader:

Sudo grep -i menuentry /boot/grub/grub.cfg | Grep "#" -v

Show the File System TABle that the system automatically mounts at startup:

Less / etc / fstab

Display the UUID (Universally Unique IDentifier) ​​value of all partitions:

Sudo blkid

Networking

List the PCI wired network devices:

Lspci | Grep -i ethernet

List the PCI wireless network devices:

Lspci | Grep -i network

List the USB network devices:

Lsusb | Grep -i ethernet; Lsusb | Grep -i network

Show modules loaded by the system to control wireless network cards:

Lsmod | Grew iwl

Show driver information used by a specific network device (replace the word interface with the logical name of the network card, for example eth0, wlan0, ath0, etc.):

Sudo ethtool -i interface
Note: The above package is not installed by default, so it is necessary to install it before using it.

Configuration of network cards and their assigned IP addresses:

Cat / etc / network / interfaces

Resolution of Domain Names:

Cat /etc/resolv.conf

Show HOSTS file contents:

Cat / etc / hosts

Name of the equipment, as it will be seen in the local network:

Cat / etc / hostname

or

Grep 127.0.1.1 / etc / hosts

or

Echo $ HOSTNAME

Local IP addresses of wired network cards (summary):

/ Sbin / ifconfig | Grep -i direc | Grep -i bcast

If the system is in English it is used:

/ Sbin / ifconfig | Grep -i addr | Grep -i bcast

Local IP Addresses for Wired Network Cards (Detail):

/ Sbin / ifconfig

Local IP addresses of wireless network cards (summary):

/ Sbin / iwconfig | Grep -i direc | Grep -i bcast

If the system is in English it is used:

/ Sbin / iwconfig | Grep -i addr | Grep -i bcast

Local IP addresses of wireless network cards (details):

/ Sbin / iwconfig

Show routing table:

Sudo route -n

To know the public (external) IP address:

Curl ip.appspot.com

Repositories / system update

View the contents of the sources.list file, which contains the addresses of the repositories:

Less /etc/apt/sources.list

Video

List the video cards (PCI / PCIe):

Lspci | Grep -i vga

To determine if the computer supports graphics acceleration, the table-utils tool package must be installed. This package contains the command glxinfo:

Glxinfo | Grep -i render

To calculate the FPS (frames per second) the following command is executed:

Timeout 60 glxgears

Which will display for 60 seconds (with the help of the timeout command) a small window with an animation of 3 gears, while at the same time in the terminal window will show the average values ​​of frames per second (FPS, frames per second ):

Example of graphical performance of a system:

338 frames in 5.4 seconds = 62.225 FPS
280 frames in 5.1 seconds = 55.343 FPS
280 frames in 5.2 seconds = 54.179 FPS
280 frames in 5.2 seconds = 53.830 FPS
280 frames in 5.3 seconds = 53.211 FPS
338 frames in 5.4 seconds = 62.225 FPS
280 frames In 5.1 seconds = 55.343 FPS
280 frames in 5.2 seconds = 54.179 FPS
280 frames in 5.2 seconds = 53.830 FPS
280 frames in 5.3 seconds = 53.211 FPS

Example of better graphic performance in another system:

2340 frames in 5.0 seconds = 467,986 FPS
2400 frames in 5.0 seconds = 479,886 FPS
2080 frames in 5.0 seconds = 415,981 FPS
2142 frames in 5.0 seconds = 428,346 FPS
2442 frames in 5.0 seconds = 488,181 FPS
2295 frames in 5.0 seconds = 458,847 FPS
2298 frames In 5.0 seconds = 459.481 FPS
2416 frames in 5.0 seconds = 483.341 FPS
2209 frames in 5.0 seconds = 441.624 FPS
2437 frames in 5.0 seconds = 487.332 FPS

To display the current X Window System configuration:

Less /etc/X11/xorg.conf

To know the current resolution (width x height) and sweep frequency (MHz):

Xrandr | Grep '*'

To know all the resolutions that the current configuration supports:

Xrandr

To display webcams (USB):

Lsusb | Grep -i camera

The following example shows the result of 2 webcams connected to the same computer:

Bus 001 Device 003: Device ID 0c45: 62c0 Microdia Sonix USB 2.0 Camera
Bus 002 Device 004: ID 0ac8: 3420 Z-Star Microelectronics Corp. Venus USB2.0 Camera
Webcams are “mounted” in consecutive order in the / dev / :

Bus 001 -> / dev / video0
Bus 002 -> / dev / video1
Bus 003 -> / dev / video2
[…] To verify that webcams have been “mounted” on their corresponding route:

Ls / dev / video * -lh

Audio

List audio hardware:

Lspci | Grep -i audio

or

Sudo lshw | Grep -i audio | Grep product
Note: The above package is not installed by default, so it is necessary to install it before using it.

List the audio playback devices:

Aplay -l | Grep -i card

List all the modules loaded by the system, to be used by the sound devices:

Lsmod | Grep -i snd

The following are tests to verify that the speakers are properly connected and distributed. The speakers must be turned on and during the test the volume, cables, and arrangement can be adjusted. Each test emits a sound in a cycle, and is repeated 2 times more:

If the sound system is 1 channel (monaural):

Speaker-test -l 3 -t sine -c 1

If the sound system is 2-channel (stereo):

Speaker-test -l 3 -t sine -c 2

If the sound system is 5.1ch (surround):

Speaker-test -l 3 -t sine -c 6

Logs (logs)

View the last 30 lines of the kernel buffer:

Dmesg | Tail -30

Display the entire kernel buffer:

Dmesg | Less

The X server logs give useful information on the current configuration of the server, and on the video card:

Cd / var / log /
Ls Xorg * -hl

It will display all the X server log files, the Xorg.0.log file being the most recent.

To view error messages and warnings:

Grep -E "(WW) | (EE)" Xorg.0.log | Grep -v unknown

If you want to see all the information in the registry:

Less Xorg.0.log

If you want to see the contents of a record previous to the current one just replace the file name Xorg.0.log with the name of the file that you want to display.

To display the boot record it is necessary to activate it first. Open the / etc / default / bootlogd file and replace the non-yes value with:

# Run bootlogd at startup?
BOOTLOGD_ENABLE = yes

During the next system boot the / var / log / boot file will be generated, which can already be checked:

Sudo less / var / log / boot

The previous boot records can be viewed with:

Sudo ls / var / log / boot * -hl

And consulted as already shown.

To view other logs: Most system logs are located in the / var / log / directory, as well as in several subdirectories, so just enter the directory and list them to know them:

Cd / var / log /
Ls -hl

Other ways to know the system

Although there are also graphical tools that allow to know the system, it is possible that the graphical environment does not work, therefore the use of the terminal is indispensable. Some of the most popular graphical tools are hardinfo and sysinfo, and to install them from the terminal just run:

Sudo aptitude install hardinfo sysinfo
Note: hardinfo appears as System Profiler and Benchmark, and sysinfo appears under the name Sysinfo.