Thank you for purchasing through links and ads on this site.
OWC / MacSales.com...
diglloyd Deal Finder...
Buy other stuff at Amazon.com...
Up to 1527MB/s sustained performance
2018 MacBook Pro NEW!
Desktop-grade performance in a laptop—finally!
Brand-new models now discounted up to $150!
View all discounted 2018 MacBook Pro...

Monitoring System Activity on the Command Line

Last updated 2013-12-29 - Send Feedback
Related: how-to, optimization

Monitoring performance in Terminal can be useful for diagnosing performance issues, using the top and vm_stat tools (and iostat for disk I/O).

These tools are used in a Terminal window. The most useful tool is top, which can be left running continually, refreshing the window at regular intervals.

top

Show top 10 processes by CPU usage every 2 seconds, with data collected every 5 seconds:

top -o cpu -s 2 -i 5
Show top 10 processes by real memory every 2 seconds:

top -o rsize -s 2

'top' display by CPU usage

vm_stat

The vm_stat tool also provides some useful statistics on the use of real memory, compressed memory and virtual memory.

'vm_stat' output

iostat

The iostat tool also provides statistics on disk I/O.

Show up to 16 drives every 2 seconds:

iostat -w 2 -n 16

iostat output at 2-second intervals
Durable and fast, up to 1800MB/s
B&H Deal ZoneDeals by Brand/Category/Savings
Deals expire in 20 hours unless noted. Certain deals may last longer.
$1299 SAVE $400 = 23.0% $19 FREE ITEMS Canon 18x50 IS Image Stabilized Binocular in All Other Categories
$1049 SAVE $450 = 30.0% $20 FREE ITEMS Canon EOS 77D DSLR with 18-135mm USM in Cameras: DSLR
$2197 SAVE $900 = 29.0% Nikon D750 DSLR with 24-120mm in Cameras: DSLR
$898 SAVE $100 = 10.0% Sony DSC-RX100 V in Cameras: Point and Shoot

diglloyd.com | Terms of Use | PRIVACY POLICY
Contact | About Lloyd Chambers | Consulting | Photo Tours
Mailing Lists | RSS Feeds | Twitter
Copyright © 2008-2017 diglloyd Inc, all rights reserved.
Display info: __RETINA_INFO_STATUS__