On Linux systems with /proc, /etc/os-release, GNU coreutils and util-linux, the command below summarizes the OS, memory, available CPU processing units and block-device capacity. Use it for a server inventory. It reports resources visible to the current environment, rather than measuring performance or exporting an Excel file.
echo "System name: $(grep PRETTY_NAME /etc/os-release | cut -d'=' -f2 | tr -d '"')" && \
echo "Total memory: $(awk '/MemTotal/ {printf "%.2f GiB\n", $2/1024/1024}' /proc/meminfo)" && \
echo "Available CPU processing units: $(nproc)" && \
echo "Total disk: $(lsblk -b -d -o SIZE,TYPE | awk '$2=="disk"{sum+=$1} END{printf "%.2f GiB\n", sum/1024/1024/1024}')"
The output looks like this:
System name: CentOS Linux 7 (Core)
Total memory: 125.39 GiB
Available CPU processing units: 96
Total disk: 3312.49 GiB
What the numbers mean
MemTotalis the total usable RAM reported by the kernel, not currently free RAM. Usefree -hto inspect current usage.nprocreports processing units available to the current process, not physical CPU sockets or physical cores.- Disk capacity sums visible block devices whose
TYPEisdisk. It is not free filesystem space; usedf -hfor mounted filesystem usage. - These calculations use powers of 1024, so the unit is GiB. Containers, virtual machines and permission limits can affect the visible resources; record the environment alongside an inventory.
References: GNU nproc manual, Linux kernel /proc documentation.