PID full path to executable in macOS Mojave
Clash Royale CLAN TAG#URR8PPP
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)
/Applications/Calculator.app/Contents/MacOS/Calculator
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.
example
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?
osx ps
add a comment |
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)
/Applications/Calculator.app/Contents/MacOS/Calculator
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.
example
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?
osx ps
ucomm just gives me the name of the process, not its location.
– Stuart Sloan
Feb 21 at 17:57
Yes ps -ax -o comm gives me a list of all process names but not their full path location. ps -ax -o comm is also truncated to 16 characters from some reason.
– Stuart Sloan
Feb 21 at 18:00
Im on mojave also.
– Stuart Sloan
Feb 21 at 18:18
Willps -ewwo comm
work for you?
– fd0
Feb 22 at 7:29
That's it! Thank you!. I can't believe it was that easy. If you want to put it in the answer I'll accept it.
– Stuart Sloan
Feb 22 at 16:32
add a comment |
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)
/Applications/Calculator.app/Contents/MacOS/Calculator
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.
example
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?
osx ps
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)
/Applications/Calculator.app/Contents/MacOS/Calculator
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.
example
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?
osx ps
osx ps
edited Feb 21 at 23:51
Stuart Sloan
asked Feb 21 at 17:32
Stuart SloanStuart Sloan
7919
7919
ucomm just gives me the name of the process, not its location.
– Stuart Sloan
Feb 21 at 17:57
Yes ps -ax -o comm gives me a list of all process names but not their full path location. ps -ax -o comm is also truncated to 16 characters from some reason.
– Stuart Sloan
Feb 21 at 18:00
Im on mojave also.
– Stuart Sloan
Feb 21 at 18:18
Willps -ewwo comm
work for you?
– fd0
Feb 22 at 7:29
That's it! Thank you!. I can't believe it was that easy. If you want to put it in the answer I'll accept it.
– Stuart Sloan
Feb 22 at 16:32
add a comment |
ucomm just gives me the name of the process, not its location.
– Stuart Sloan
Feb 21 at 17:57
Yes ps -ax -o comm gives me a list of all process names but not their full path location. ps -ax -o comm is also truncated to 16 characters from some reason.
– Stuart Sloan
Feb 21 at 18:00
Im on mojave also.
– Stuart Sloan
Feb 21 at 18:18
Willps -ewwo comm
work for you?
– fd0
Feb 22 at 7:29
That's it! Thank you!. I can't believe it was that easy. If you want to put it in the answer I'll accept it.
– Stuart Sloan
Feb 22 at 16:32
ucomm just gives me the name of the process, not its location.
– Stuart Sloan
Feb 21 at 17:57
ucomm just gives me the name of the process, not its location.
– Stuart Sloan
Feb 21 at 17:57
Yes ps -ax -o comm gives me a list of all process names but not their full path location. ps -ax -o comm is also truncated to 16 characters from some reason.
– Stuart Sloan
Feb 21 at 18:00
Yes ps -ax -o comm gives me a list of all process names but not their full path location. ps -ax -o comm is also truncated to 16 characters from some reason.
– Stuart Sloan
Feb 21 at 18:00
Im on mojave also.
– Stuart Sloan
Feb 21 at 18:18
Im on mojave also.
– Stuart Sloan
Feb 21 at 18:18
Will
ps -ewwo comm
work for you?– fd0
Feb 22 at 7:29
Will
ps -ewwo comm
work for you?– fd0
Feb 22 at 7:29
That's it! Thank you!. I can't believe it was that easy. If you want to put it in the answer I'll accept it.
– Stuart Sloan
Feb 22 at 16:32
That's it! Thank you!. I can't believe it was that easy. If you want to put it in the answer I'll accept it.
– Stuart Sloan
Feb 22 at 16:32
add a comment |
1 Answer
1
active
oldest
votes
So on MacOS X this command works great. This was provided by @fd0
ps -ewwo comm
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502138%2fpid-full-path-to-executable-in-macos-mojave%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
So on MacOS X this command works great. This was provided by @fd0
ps -ewwo comm
add a comment |
So on MacOS X this command works great. This was provided by @fd0
ps -ewwo comm
add a comment |
So on MacOS X this command works great. This was provided by @fd0
ps -ewwo comm
So on MacOS X this command works great. This was provided by @fd0
ps -ewwo comm
answered Feb 25 at 18:57
Stuart SloanStuart Sloan
7919
7919
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502138%2fpid-full-path-to-executable-in-macos-mojave%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
ucomm just gives me the name of the process, not its location.
– Stuart Sloan
Feb 21 at 17:57
Yes ps -ax -o comm gives me a list of all process names but not their full path location. ps -ax -o comm is also truncated to 16 characters from some reason.
– Stuart Sloan
Feb 21 at 18:00
Im on mojave also.
– Stuart Sloan
Feb 21 at 18:18
Will
ps -ewwo comm
work for you?– fd0
Feb 22 at 7:29
That's it! Thank you!. I can't believe it was that easy. If you want to put it in the answer I'll accept it.
– Stuart Sloan
Feb 22 at 16:32