By running ps aux
I can get list running processes with command associated with them, e.g.
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
_windowserver 142 2.0 1.3 4559968 224672 ?? Ss 7:11AM 33:21.95 /System/Library/PrivateFrameworks/SkyLight.framework/Resources/WindowServer -daemon
lrogalsk 6419 1.9 0.5 2703580 77588 ?? S 2:15PM 0:40.88 /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal
...
Unfortunately, COMMAND
includes command line arguments and absolute path of file, both of which may contain spaces. How can I get process name in deterministic manner?
Best Answer
Apparently I'm blind.
ps auxc
works just fine.