Skip to content

Get Linux System Information

Get System Hardware Information

sudo inxi -Faxz
sudo hostnamectl
sudo inxi -b

Get System Serial Number

sudo dmidecode -s system-serial-number

Get Machine ID

cat /etc/machine-id

Get Mother-Board Serial Number

sudo dmidecode -s baseboard-serial-number

Get CPU Information

lscpu
sudo dmidecode -t processor
sudo hwinfo --cpu
sudo inxi -C
sudo lshw -class processor
sudo inxi -t
taskset -p PID
cat /proc/cpuinfo

Get Memory Information

sudo dmidecode -t memory
sudo lshw -C memory
sudo inxi -mxz
cat /proc/meminfo

Get Disk Information

lsblk
sudo fdisk -l
sudo inxi -d
sudo inxi -p
blkid
sudo df -Th
mount | grep '^/'

OS Information

Using lsb_release

lsb_release -a
Options for `lsb_release` `-a` for all details `-c` codename `-r` release number `-i` distribution ID
hostnamectl
cat /etc/os-release

Get Hostname and FQDN

hostname
uname -n
cat /etc/hostname
cat /proc/sys/kernel/hostname
sysctl kernel.hostname
echo $HOSTNAME
set | grep HOSTNAME

Get Kernel Information

uname -r
cat /proc/version

Kernel Boot Command line

cat /proc/cmdline

Check Modules loaded in kernel

lsmod

Check Kernel Parameters

sysctl -a

Get information about Init System

Run this to know which init system is setup

readlink /sbin/init

:::info Incase of /sbin/Busybox as an init, system may use Open-rc as service manager

To confirm run

command -v openrc && echo "OpenRC is installed"
:::


Log Managers in Linux System

systemctl is-active systemd-journald rsyslog syslog-ng

Package Manager in Linux System

Run the command to check package manager available

which {apt,dpkg,dnf,yum,rpm,pacman,apk,zypper,pkg,snap,flatpak,opkg,snap,flatpak} 2>/dev/null

Service Manager in Linux System

check init system

 ps -p 1 -o comm=

or

which {systemctl,initctl,service,openrc,runit,s6-svscan} 2>/dev/null

This is Bash Code

Bash Script
sudo apt update

This CSH

CSH script
sudo apt-get -y update
Info

this os info

Test info

info iis

END