How do I get command line arguments passed to a running process on a UNIX/Linux system?


Hemant:

On SunOS, there is pargsa command that prints command line arguments passed to a running process.

Are there any similar commands on other Unix environments?

markus_b:

There are several options:

ps -fp <pid>
cat /proc/<pid>/cmdline | sed -e "s/\x00/ /g"; echo

/proc/<pid>For more information on Linux , take a look.

On other Unixes, things may be different. The pscommand will appear everywhere, /procdepending on the operating system. cmdlineFor example, there is no in on AIX /proc.

Related


How do I get the command line that starts the process

velvet: From Java, is it possible to get the full command line with all the arguments to start the application? System.getEnv()and System.getProperties()doesn't seem to contain these values. Stephen Denne: Some of these are available from RuntimeMXBean by call

How do I get the command line that starts the process

velvet: From Java, is it possible to get the full command line with all the arguments to start the application? System.getEnv()and System.getProperties()doesn't seem to contain these values. Stephen Denne: Some of these are available from RuntimeMXBean by call

How do I get the command line that starts the process

velvet: From Java, is it possible to get the full command line with all the arguments to start the application? System.getEnv()and System.getProperties()doesn't seem to contain these values. Stephen Denne: Some of these are available from RuntimeMXBean by call

How can I escape arguments passed in bash script command line

master: I have a variable which comes from somewhere: VAR1='hhgfhfghhgf"";2Ddgfsaj!!!$#^$\'&%*%~*)_)(_{}||\\/' Now I have a command like this ./myscript.sh '$VAR1' I got $VAR1 from some comparisons and when I display it it looks exactly like above. Now the c

How can I escape arguments passed in bash script command line

master: I have a variable which comes from somewhere: VAR1='hhgfhfghhgf"";2Ddgfsaj!!!$#^$\'&%*%~*)_)(_{}||\\/' Now I have a command like this ./myscript.sh '$VAR1' I got $VAR1 from some comparisons and when I display it it looks exactly like above. Now the c

How to use passed arguments in command line

蝠 ta I want to use the passed arguments in the command line. My program is to generate latex files from many latex files using checkboxes. This configuration file is made in JSON format when generating the configuration file for saving and loading the selected

How to use passed arguments in command line

蝠 ta I want to use the passed arguments in the command line. My program is to generate latex files from many latex files using checkboxes. This configuration file is made in JSON format when generating the configuration file for saving and loading the selected

How to read txt passed as command line arguments

Toxic Agent I want to use the argparse module to pass a txt file with command line arguments and use a open()function to read the file, but the first thing I get is this error: AttributeError: 'dict' object has no attribute 's' this is my code import argparse

How to use passed arguments in command line

蝠 ta I want to use the passed arguments in the command line. My program is to generate latex files from many latex files using checkboxes. This configuration file is made in JSON format when generating the configuration file for saving and loading the selected

How to use passed arguments in command line

蝠 ta I want to use the passed arguments in the command line. My program is to generate latex files from many latex files using checkboxes. This configuration file is made in JSON format when generating the configuration file for saving and loading the selected

How to use passed arguments in command line

蝠 ta I want to use the passed arguments in the command line. My program is to generate latex files from many latex files using checkboxes. This configuration file is made in JSON format when generating the configuration file for saving and loading the selected

Get process command line arguments from minidump

Clem I'm working on a BSOD and I'd like to learn more about the process that causes the problem. I can open the minidump in WinDbg, which gives a lot of information about the crash. However, one piece of information I can't get is the command line arguments of

Get process command line arguments from minidump

Clem I'm working on a BSOD and I'd like to learn more about the process that causes the problem. I can open the minidump in WinDbg, which gives a lot of information about the crash. However, one piece of information I can't get is the command line arguments of