Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 405 Bytes

retrieve-args-used-to-launch-a-process.adoc

File metadata and controls

12 lines (8 loc) · 405 Bytes

Retrieve args used to launch a process

We sometimes need to know which command line has been used to launch a process.

To retrieve the entire command, just issue: ps -p <pid> -o args and you will get:

COMMAND
<the command line used to launch the process>

If you need to parse it programmatically, just pipe it with sed: ps -p <pid> -o args | sed -n '2p' to retrieve only the second line.