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 usageiostat
: I/O summary statistics for terminal, device and CPU operationsvm_stat
: Mach virtual memory statisticsdiskutil list
: disk/volume capacitydf
: used/free space on mounted partitionsfs_usage
: real-time file activity for both disk and networknettop
: updated information about the network (a bit liketop
for net I/O)w
: who is logged in and what they are doing; plus a brief system load summaryifconfig
andipconfig
: 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
orfs_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
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.