Gathering information and monitoring an Ubuntu system from a terminal

Though this information applies to any GNU/Linux kernel I thought it would be helpful to describe some ways in which to uncover information about a system through a terminal. This is especially useful when running Ubuntu Server without any graphical desktop environment but can also be useful for desktop users. Mostly I’ll just reveal some useful locations to find information in the /proc and /dev directories.

System information

  • cat /proc/cpuinfo
    Lists each CPU core and its model, current speed, l2 cache size, and a number of flags describing the capabilities of the cpu and supported instructions.
  • cat /proc/meminfo
    Lists lots of details about memory and swap status. Can be monitored with the command watch cat /proc/meminfo.
  • cat /proc/interrupts
    Useful in diagnosing some problems and also in checking to see if NMI is enabled and functioning.
  • cat /proc/loadavg
    Mostly the same information shown in top but useful for scripting based on load.

Disk information

  • cat /proc/mdstat
    If running GNU/Linux software RAID this will show the state of the RAID arrays and progress report in a resynchronization. The command watch cat /proc/mdstat can be useful in monitoring a resynchronization.
  • cat /proc/diskstats
    Not easy to use because I, and I suspect most people, will have to look up what each field means. But these can be very useful in understanding the disk workload of a server.
  • cat /proc/partitions
    Shows the layout of all disks. This can be very helpful if one does not know the layout of a system.
  • cat /proc/swaps
    This will display the active swap files and partitions on the system.
  • ls -l /dev/disk/by-uuid
    This shows the UUID’s of all partitions and which partition they map to.
  • ls /dev/mapper
    Lists the current device mapper devices.
Creative Commons License Except where otherwise noted, content on this site is licensed under a Creative Commons by-nc-sa 3.0 License