Find your Linux server's specifications
Display the CPU, memory, disks, network and system of your Linux server with lscpu, free, lsblk and ip, and interpret these values correctly on a VPS.
On this page
This guide shows you how to find out the CPU, memory, disks and network of your Linux server from an SSH session. These commands are read-only: they do not change your configuration. They work on Debian, Ubuntu, Rocky Linux and AlmaLinux.
Prerequisites
- SSH access to your server
sudoprivileges for some detailed commands
Most of the tools are already present. Install the optional ones as follows:
# Debian, Ubuntu
sudo apt install ethtool dmidecode pciutils smartmontools nvme-cli sysstat
# Rocky Linux, AlmaLinux
sudo dnf install ethtool dmidecode pciutils smartmontools nvme-cli sysstatGet a summary in one go
Copy this block into your terminal to display the essentials:
{
echo "== System"; grep '^PRETTY_NAME=' /etc/os-release; uname -srm
echo "== CPU"; LC_ALL=C lscpu | grep -E '^(Model name|CPU\(s\)|Thread|Core|Socket)'
echo "== Memory"; free -h
echo "== Disks"; lsblk -d -e 7,11 -o NAME,SIZE,ROTA,TYPE,MODEL
echo "== Network"; ip -br address; ip route show default
}The following sections go through each part in detail.
System and virtualization
cat /etc/os-release
uname -srm
hostnamectl
systemd-detect-virt/etc/os-releasegives the distribution and its version.uname -srmshows the kernel and the architecture, for examplex86_64oraarch64.systemd-detect-virtshows the virtualization technology, for examplekvm. The valuenonemeans that no virtualization was detected.
CPU
LC_ALL=C lscpu
nprocLC_ALL=C keeps the labels in English, which makes them easier to search for. The most useful lines are:
| Line | Meaning |
|---|---|
Architecture |
CPU architecture |
CPU(s) |
Number of visible logical processors, i.e. the vCPUs on a VPS |
Model name |
Model reported to the system |
Thread(s) per core |
Threads per core |
Core(s) per socket |
Cores per processor |
Socket(s) |
Number of processors |
Hypervisor vendor |
Detected hypervisor |
Virtualization type |
Type of virtualization |
To see how each logical processor is laid out:
lscpu -e=CPU,CORE,SOCKET,ONLINECheck whether the CPU is available
vmstat 1 5The st (steal) column shows the time the virtual machine spent waiting for the physical CPU. The id column shows idle time, and wa the time spent waiting for disks. High, sustained st values can explain a slowdown. Ignore the first line, which summarizes the period since boot.
Memory
free -h
swapon --show
grep -E '^(MemTotal|MemAvailable|SwapTotal):' /proc/meminfoIn free -h, focus on:
- total: memory visible to the system
- available: memory actually available for new applications
- buff/cache: cache that Linux frees when needed
A low free value is therefore nothing to worry about as long as available remains comfortable.
On some machines, dmidecode also gives details of the memory modules. On a VPS, it describes the virtual hardware:
sudo dmidecode -t memoryDisks
List of physical or virtual disks:
lsblk -d -e 7,11 -o NAME,SIZE,ROTA,TYPE,TRAN,MODELPartitions, filesystems and mount points:
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT
df -hT -x tmpfs -x devtmpfsROTAis0for a disk reported as non-rotational, and1for a disk reported as rotational.SIZEinlsblkshows the size of the disk or partition.dfshows the usable space in the filesystem.
To analyze what is filling the disk, see Check Disk Space and Usage in Linux.
On a physical server, you can also query the health of the disks:
sudo smartctl -i /dev/sda
sudo nvme listNetwork
Interfaces and addresses:
ip -br address
ip -br linkDefault route, in IPv4 then IPv6:
ip route show default
ip -6 route show defaultIPv4 address the server uses to reach the Internet, without sending any traffic:
ip -4 route get 1.1.1.1 | grep -oP 'src \K\S+'DNS servers and listening ports:
cat /etc/resolv.conf
sudo ss -tulpnReported speed and counters of the main interface:
IFACE=$(ip route show default | awk '{print $5; exit}')
echo "$IFACE"
sudo ethtool "$IFACE" | grep -E 'Speed|Duplex|Link detected'
ip -s link show "$IFACE"The errors and dropped counters should stay low. If they keep rising, note the values and the time before contacting support.
The reported speed is not a measured throughput. To measure the real throughput, follow Test server bandwidth.
Command summary
| Purpose | Command |
|---|---|
| System version | cat /etc/os-release |
| Kernel and architecture | uname -srm |
| Virtualization type | systemd-detect-virt |
| CPU | LC_ALL=C lscpu |
| Number of vCPUs | nproc |
| Stolen CPU time | vmstat 1 5 |
| Memory | free -h |
| Swap | swapon --show |
| Disks | lsblk -d -e 7,11 -o NAME,SIZE,ROTA,TYPE,MODEL |
| Partitions | lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT |
| Used space | df -hT -x tmpfs -x devtmpfs |
| Network addresses | ip -br address |
| Gateway | ip route show default |
| Listening ports | sudo ss -tulpn |
Interpret the values on a VPS
A VPS sees virtual hardware. Some information therefore describes what the hypervisor presents, not necessarily the physical machine:
- The CPU model can be generic, for example
QEMU Virtual CPU. Thread(s) per coreandSocket(s)describe the virtual topology.ROTAandMODELdo not always reveal the actual storage type.- The interface speed may be missing or unrelated to your throughput.
To check your plan, compare the number of vCPUs, the memory and the disk size with the information in your client area.
Troubleshooting
The memory shown is lower than in your plan
A small difference is normal: the kernel and the virtual hardware reserve part of the memory before free does its calculation, and free -h counts in Gi (base 2), a larger unit than the GB (base 10), which gives a smaller number for the same amount of memory. If the difference is large, note the output of free -h and contact support.
The disk is larger than the partition
If lsblk shows a disk larger than its partition, for example after a capacity upgrade, the extra space is not usable yet. Make a backup, then identify the disk, the partition number and the filesystem:
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTInstall growpart with cloud-guest-utils on Debian and Ubuntu, or cloud-utils-growpart on Rocky Linux and AlmaLinux. In this example, partition 1 of the /dev/vda disk is extended:
sudo growpart /dev/vda 1
sudo resize2fs /dev/vda1 # ext4
sudo xfs_growfs / # XFS mounted on /Run only the command matching your filesystem. If the disk uses LVM, the logical volume must be extended as well.
command not found
| Command | Debian, Ubuntu package | Rocky Linux, AlmaLinux package |
|---|---|---|
lscpu, lsblk |
util-linux |
util-linux |
free, vmstat |
procps |
procps-ng |
ip, ss |
iproute2 |
iproute |
ethtool |
ethtool |
ethtool |
dmidecode |
dmidecode |
dmidecode |
lspci |
pciutils |
pciutils |
smartctl |
smartmontools |
smartmontools |
ifconfig and netstat belong to the old net-tools package. Use ip and ss instead.
No SMBIOS nor DMI entry point found, sorry.
The environment does not present a hardware table to dmidecode. Use lscpu, free and lsblk, which are enough to see the visible resources.
Speed: Unknown! with ethtool
This result is common with a virtual network card. It does not indicate a fault. Check Link detected instead, then measure the real throughput.
smartctl returns no information
A virtual disk generally does not expose SMART data. This data is managed at the host machine level.
References
- Manual pages:
man lscpu,man lsblk,man free,man vmstat,man ip,man ss,man ethtool - Check Disk Space and Usage in Linux
- Test server bandwidth