terminal show running processes tree mac os

C++
Install pstree with the following command:

brew install pstree
Source

Also in C++: