Apple - Can I view system stats in the Terminal?

Depending on what you want displayed there are several options available using Terminal:

  • top: real-time sorted display of running processes such as memory and CPU usage
  • iostat: I/O summary statistics for terminal, device and CPU operations
  • vm_stat: Mach virtual memory statistics
  • diskutil list: disk/volume capacity
  • df: used/free space on mounted partitions
  • fs_usage: real-time file activity for both disk and network
  • nettop: updated information about the network (a bit like top for net I/O)
  • w: who is logged in and what they are doing; plus a brief system load summary
  • ifconfig and ipconfig: network interface and IP protocol details

Most of these commands have a huge list of options.  It's probably best to consult the man pages for details.

I usually rely on:

  • top -u -s 10 to identify CPU-hogging processes;
  • fs_usage -f filesys or fs_usage -f network to identify processes generating a lot of disk/network load.

The iStats ruby gem lets you see the CPU temperature via the command-line.

Installation

$ gem install iStats

Usage

$ istats

Screenshot


You can use top. It'll show CPU & RAM usage together with all the processes. It'll also show you network packets in/out, and discs data read/written.

Tags:

Macos

Terminal