This topic was published by DevynCJohnson and viewed 1651 times since "". The last page revision was "".
- Topics - 444
When using Linux, there are a variety of ways users can figure out what hardware is present and get various details about the hardware and system. This may be important to test which hardware was properly recognized and working or to assess the usefulness of a computer. In addition, this information helps Linux users know their hardware when compiling a kernel specifically tuned for their system. Also, the admin may need to gather information about the Linux system. Some Linux systems may not have certain commands and utilities installed, so multiple methods of getting this information will be provided.
To view information about the CPU, type
If that method fails, or if more information is needed, then type
The "df" command provides information on the storage usage. Each filesystem is listed with the total, used, and free space. Using the "-a" parameter lists additional filesystems (the psuedo-filesystems).
The "du" command prints a detailed list of the space usage for each directory and sub-directory.
If RAID is present, then
cat /proc/mdstatdisplays information regarding the RAID devices.
"cat /proc/filesystems" displays the filesystems that are supported by the active Linux kernel. To see which filesystems are currently mounted, type "cat /proc/mounts" or "mount".
Information concerning the partitions is displayed by executing "cat /proc/partitions".
Partition information can be viewed by executing
fdisk -lwith Root privileges.
For an extensive list of hardware information, execute the "lshw" command. This command runs better with Root privileges and provides additional information that is more accurate than running the command without Root privileges.
To view the list of configured and supported block and character devices that are currently usable on the system, type
To view the list of loaded modules running with the currently active Linux kernel, type "cat /proc/modules". The first column is the module's name and the second column is the memory usage of the module in bytes. Next, in the third column, the number of module instances running is shown. A "0" indicates that the module was unloaded. Next, the modules dependencies are listed. Afterwards, the module's current state is listed. Lastly, the sixth column shows the first memory address of the module.
Alternatively, to list currently loaded kernel modules, execute
lsmodin a command-line.
Many computer users may need information concerning their computer's memory. Running
less /proc/meminfoprovides a lot of information about the system's memory. Also, this method works on most Linux systems.
Another method is to run "free" which displays the amount of memory that is free and used compared to the total.
"vmstat" is another tool that provides information about the memory.
The user can see how the memory is allocated for each physical device by typing
cat /proc/iomem. The first column shows the memory register and the next column shows what device is using that register range.
For information about the memory at the "slab level", type
cat /proc/slabinfo. As an alternative, type "slabtop". A slab is a single set of memory that is not fragmented. This means that the set of memory is contiguous and dedicated to a particular resource or object.
cat /proc/swapsprovides information about the system's swap space (if swap space exists).
The "ifconfig" command lists the various network devices, their mac address, and various other information. An alternative command is "ip address show".
Type "hostname" to view the system's hostname. As an alternative, type
The "lspci" command is similar to the "lsusb" command, but this is for information about the PCI devices. Type
lspci -tvto get additional PCI information. If "lspci" fails, try "cat /proc/pci".
The I/O ports can be viewed with
cat /proc/ioportswhich displays the port address and the device that is using that address or address range.
Various system statistics stored in /proc/ cna be displayed using "procinfo".
For information about the system in general, type "uname -a" to see the system's kernel version, distro type, etc. To view the kernel version, type "uname -r".
As an alternative, "lsb_release -a" displays some of the same information. As an additional alternative, type
cat /proc/cryptolists all of the cryptographic ciphers that the active Linux kernel supports. Also, some information regarding each cipher is provided.
To see the parameters that were given to the kernel during boot-time, type
cat /proc/cmdline. These parameters were likely given to the kernel by GRUB or some other bootloader.
To see how long the system has been on, type "uptime". As an alternative, type "cat /proc/uptime". The first column is the system's uptime in seconds and the second column is the idle time in seconds.
Various hardware and BIOS information can be gathered using the "dmidecode" command. To use the command, type
dmidecode -t X, where "X" is a number indicating the information category. The various categories recognized by dmidecode are listed below.
- 0 BIOS
- 1 System
- 2 Base Board
- 3 Chassis
- 4 Processor
- 5 Memory Controller
- 6 Memory Module
- 7 Cache
- 8 Port Connector
- 9 System Slots
- 10 On Board Devices
- 11 OEM Strings
- 12 System Configuration Options
- 13 BIOS Language
- 14 Group Associations
- 15 System Event Log
- 16 Physical Memory Array
- 17 Memory Device
- 18 32-bit Memory Error
- 19 Memory Array Mapped Address
- 20 Memory Device Mapped Address
- 21 Built-in Pointing Device
- 22 Portable Battery
- 23 System Reset
- 24 Hardware Security
- 25 System Power Controls
- 26 Voltage Probe
- 27 Cooling Device
- 28 Temperature Probe
- 29 Electrical Current Probe
- 30 Out-of-band Remote Access
- 31 Boot Integrity Services
- 32 System Boot
- 33 64-bit Memory Error
- 34 Management Device
- 35 Management Device Component
- 36 Management Device Threshold Data
- 37 Memory Channel
- 38 IPMI Device
- 39 Power Supply
lsusbcommand displays various USB information. Typing "lsusb -tv" displays the detected USB devices in a tree format with additional information.
To list SCSI devices, type
To list Firewire devices, type
lspci | grep -E -i "(1394|firewire)".
Information about various devices detected at boot-time can be found using "dmesg" with "grep" such as
dmesg | grep -i tty.
Information concerning block devices can be viewed using
- Methods for Determining the System Architecture - http://dcjtech.info/topic/methods-for-determining-the-system-architecture/
- Summary of Various Hardware Types and Protocols - http://dcjtech.info/topic/summary-of-various-hardware-types-and-protocols/
- Nvidia Devices and Technology - http://dcjtech.info/topic/nvidia-devices-and-technology/
- Introductory Microprocessor Concepts - http://dcjtech.info/topic/introductory-microprocessor-concepts/
- x86 vs i386 vs Other Processor Terms - http://dcjtech.info/topic/x86-vs-i386-vs-other-processor-terms/