Skip to content

Linux & shell: Kernel, hardware & limits

8 Linux & shell commands: Kernel, hardware & limits. Click a command to see what each part does.

Index
8 items
Click a command to see what each part does.

Kernel, hardware & limits8

  • sudo dmesg -T | tail -50Kernel messages with readable times

    What each part does

    1. dmesgkernel ring buffer: hardware errors, OOM killer, disk and network driver messages
    2. -Thuman-readable timestamps
    3. | tail -50the latest 50 lines
  • sudo dmesg -T | grep -i -E 'killed process|out of memory'Did the OOM killer kill something?

    What each part does

    1. grep -i -E '...'lines where the kernel killed a process to free memory, with its name and memory use
  • lscpu; lspci; sudo dmidecode -t systemHardware overview

    What each part does

    1. lscpuCPU model, cores, threads, virtualization
    2. lspciPCI devices: NICs, GPUs, storage controllers
    3. dmidecode -t systemvendor, model and serial number
  • sysctl <key>; sudo sysctl -w <key>=<value>Read and change kernel parametersCaution

    What each part does

    1. sysctl <key>e.g. vm.swappiness, net.ipv4.ip_forward, fs.file-max
    2. sysctl -w <key>=<value>change it now; put it in /etc/sysctl.d/*.conf to keep it after reboot
  • ulimit -n; cat /proc/<pid>/limitsOpen-file and process limits

    What each part does

    1. ulimit -nmax open files for this shell (Too many open files means you hit it)
    2. /proc/<pid>/limitsthe actual limits of a running process (systemd services set LimitNOFILE)
  • lsmod | grep <module>; sudo modprobe <module>Kernel modules

    What each part does

    1. lsmodloaded modules
    2. modprobe <module>load a module with its dependencies (e.g. br_netfilter for Kubernetes)
  • timedatectlTime, timezone and NTP sync

    What each part does

    1. timedatectllocal time, UTC, timezone and whether the clock is NTP-synchronized (clock skew breaks TLS and tokens)
  • uptimeUptime and load average

    What each part does

    1. uptimehow long since boot, users, and 1/5/15-minute load averages (compare with CPU count)

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…