ps axww -o command
This command gives me the "command" used to run the process. It also includes the "path" to the executable. I need ONLY the path. The problem is it also includes arguments with the path. I don't want the arguments.
example without args (This one is good)
example with args (This one isn't because it has --type=utility at the end)
/Applications/Google Chrome.app/Contents/Versions/.*.****.*/Google Chrome Helper.app/Contents/MacOS/Google Chrome Helper --type=utility
I know I can use | cut to cut the args like this
ps axww -o command | cut -f1 -d"-"
But now I'm having to add a ton of cuts to keep up with all the different switches on the different commands.
ps axww -o command | cut -f1 -d"-" | cut -f1 -d"("
and so on. Is there a way to get the full file path of all currently running processes and not this hack of showing the "command" which just happens to include the path?