From Mac Guides
top is a Terminal command used to display a list of running processes, similar to Activity Monitor. By default it shows CPU usage and CPU time, as well as number of threads and memory usage statistics.
To show all the running processes:
To show all the running processes, sorted by CPU usage:
To show all the running processes, sorted by cumulative CPU usage (and just let it run...):
top -ca -u
Man Page Excerpt
The top program periodically displays a list of processes on the system in sorted order. The default key for sorting is pid, but other keys can be used instead. Various output options are available.