How do the commands top and ps calculate CPU utilization using the /proc/[$pid]/stat file? Also how do they obtain memory utilization information about the process?
Workings of top and ps commands
linux;command line