"top" - Display Top Processes

This section provides a tutorial example on how to use the 'top' command to display running processes sorted by top usages and keep them updated on the screen.

What Is the "top" Command? - The "top" command displays running processes sorted by top usages and keep them updated on the screen. A good summary is also displayed.

Here is an example of the "top" command output screen.

herong$ top

Processes: 756 total, 2 running, 1 stuck, 753 sleeping, 2899 threads
Load Avg: 1.74, 1.83, 1.78  CPU usage: 7.91% user, 4.93% sys, 87.15% idle
SharedLibs: 206M resident, 44M data, 33M linkedit.
MemRegions: 190263 total, 3866M resident, 206M private, 1497M shared.
PhysMem: 13G used (3090M wired), 3393M unused.
VM: 4383G vsize, 628M framework vsize, 13873787(0) swapins, 14820988(0) swapouts.
Networks: packets: 9401983/2572M in, 811314/290M out.
Disks: 5649171/141G read, 1523876/112G written.

PID   COMMAND      %CPU TIME     #TH #WQ #PORTS MEM   PURG CMPRS PGRP  PPID STATE    BOOSTS
98134 com.apple.We 0.0  00:27.85 6   2   188    6432K 0B   59M   98134 1    sleeping *0[19279]
96564 periodic-wra 0.0  00:00.00 2   2   26     8192B 0B   460K  96564 1    sleeping *0[1]
96384 netbiosd     0.0  00:26.07 4   4   33     1568K 0B   1964K 96384 1    sleeping *0[1]
94935 storeinappd  0.0  00:00.18 2   1   63     428K  0B   4284K 94935 1    sleeping  0[1]
94477 mdworker     0.0  00:16.05 5   2   55     32M   0B   14M   94477 1    sleeping *0[1]
94434 VisualizerSe 0.0  00:02.84 4   2   140    1088K 0B   29M   94434 1    sleeping *0[79]
94433 fpsd         0.0  00:00.02 2   1   24     8192B 0B   760K  94433 1    sleeping  0[1]
94432 com.apple.BK 0.0  00:00.15 2   1   44     428K  0B   1484K 94432 1    sleeping  0[2]
94431 iTunes       0.0  00:10.95 20  2   486    12M   0B   94M   94431 1    sleeping *0[1123]

You can also specify the pid (process id) to watch resource usages of a given process using the "-pid n" option.

herong$ top -pid 98134

...
PID   COMMAND      %CPU TIME     #TH  #WQ  #POR MEM    PURG CMPR PGRP  PPID STATE    ...
98134 com.apple.We 0.0  00:30.74 6    2    188  6776K  0B   59M  98134 1    sleeping ...

Table of Contents

 About This Book

 Macintosh OS (Operating System) History

 macOS Operating System

 macOS File Systems

 macOS Network Connections

System and Application Processes

 What Is a Running Process

 Use Activity Monitor on macOS

 "ps" - Process Status Command

"top" - Display Top Processes

 "nettop" - Processes Top Network Usages

 "Finder" Process - File Browser on Mac

 "WindowServer" Process - Drawing Graphics on Screen

 "Dock" Related Processes

 "Siri" Processes - Voice Command Interpreter

 "mds" Processes - Metadata Server and Spotlight

 "spindump" Processes - Dump Memory Contents

 "login" Processes - Login Window and Services

 "softwareupdate" Processes - Update System and Apps

 "TeamsUpdater" Process from Microsoft Teams

 Keychain Access - Password Manager

 Keychain Access - Certificate Manager

 Productivity Tools on macOS

 Programming Tools on macOS

 Apache Web Server on macOS

 Develop and Run Java Applications

 Full Version in PDF/EPUB