2

Command ps aux displays the list, but where does it get it from - kernel itself or launchd?

  • 1
    It gets it from running processes, there is no list. If you open Activity Monitor in Applications/Utilities it will give you a GUI version of "PS" – Steve Chambers Jun 11 '18 at 23:35
  • @SteveChambers So it loops through all the RAM? – DIES Jun 11 '18 at 23:39
  • No idea HOW it works but it enumerates all running processes. – Steve Chambers Jun 11 '18 at 23:59
  • 4
    The kernel has a list of all running processes, indexed by process id. ps just lists that table. – nohillside Jun 12 '18 at 4:06
7

The ps command enumerates the mach kernel process listing in a similar manner to how many linux (which don't use mach kernel) expose this as the /proc filesystem.

macOS and tvOS and iOS and watchOS all share the same underlying core OS:

If you want to see the source code - check out xnu section at https://opensource.apple.com/source/xnu/xnu-4570.41.2/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .