Linux: Command-line utilities for obtaining information

This post was written by eli on July 21, 2019
Posted Under: Linux,Notes to self,Server admin,systemd

There are many ways to ask a Linux machine how it’s doing. I’ve collected a few of them, mostly for my own reference. I guess I’ll add more items as I run across new ones.

General Info

  • inxi -Fxxxz (neat output, but makes the system send me security “password required” alert mails because of attempts to execute hddtemp).
  • hwinfo
  • lshw
  • Temperature and fans: sensors
  • hostnamectl (host name, kernel version, Distribution etc.)
  • dmidecode: Lots of info on and by the BIOS (From computer model an make down to exact part number of installed DIMM memories etc.)

Status

  • Logs: journalctl and dmesg
  • systemctl, with all its variants
  • Network: ifconfig
  • Wifi: iwconfig
  • Bluetooth: hciconfig, bluetootctl, btmon (for dumping traffic)
  • CPU: lscpu
  • PCI bus: lspci
  • USB: lsusb
  • RAID: mdadm –detail /dev/md0

Operating system

  • List open files: lsof
  • Memory usage: free, lsmem and read /proc/buddyinfo
  • Various kernel statistics (including memory): vmstat (takes info from /proc/stat and /proc/meminfo in particular)
  • Block devices and partitions: blkid and lsblk
  • List namespaces: lsns
  • List loaded kernel modules: lsmod
  • List locks: lslocks

Add a Comment

required, use real name
required, will not be published
optional, your blog address