- The hostname and uname commands print the hostname of the current system:
$ hostname
Alternatively, they print the following:
$ uname -n
server.example.com
- The -a option to uname prints details about the Linux kernel version, hardware architecture, and more:
$ uname -a
server.example.com 2.6.32-642.11.1.e16.x86_64 #1 SMP Fri Nov 18
19:25:05 UTC 2016 x86_64 x86_64 GNU/Linux
- The -r option limits the report to the kernel release:
$ uname -r
2.6.32-642.11.1.e16.x86_64
- The -m option prints the machine type:
$ uname -m
x86_64
- The /proc/ directory holds information about the system, modules, and running processes. /proc/cpuinfo contains CPU details:
$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 63
model name : Intel(R)Core(TM)i7-5820K CPU @ 3.30GHz
...
If the processor has multiple cores, these lines will be repeated n times. To extract only one item of information, use sed. The fifth line contains the processor name:
$ cat /proc/cpuinfo | sed -n 5p
Intel(R)CORE(TM)i7-5820K CPU @ 3.3 GHz
- /proc/meminfo contains information about the memory and current RAM usage:
$ cat /proc/meminfo
MemTotal: 32777552 kB
MemFree: 11895296 kB
Buffers: 634628 kB
...
The first line of meminfo shows the system's total RAM:
$ cat /proc/meminfo | head -1
MemTotal: 1026096 kB
- /proc/partitions describes the disk partitions:
$ cat /proc/partitions
major minor #blocks name
8 0 976762584 sda
8 1 512000 sda1
8 2 976248832 sda2
...
The fdisk program edits a disk's partition table and also reports the current partition table. Run this command as root:
$ sudo fdisk -l
- The lshw and dmidecode applications generate long and complete reports about your system. The report includes information about the motherboard, BIOS, CPU, memory slots, interface slots, disks, and more. These must be run as root. dmidecode is commonly available, but you may need to install lshw:
$ sudo lshw
description: Computer
product: 440BX
vendor: Intel
...
$ sudo dmidecode
SMBIOS 2.8 present
115 structures occupying 4160 bytes.
Table at 0xDCEE1000.
BIOS Information
Vendor: American Megatrends Inc
...