On SunOS there is pargs
command that prints the command line arguments passed to the running process.
Is there is any similar command on other Unix environments?
On SunOS there is pargs
command that prints the command line arguments passed to the running process.
Is there is any similar command on other Unix environments?
try "ps -n" in a linux terminal. this will show:
1.All processes RUNNING, their command line and their PIDs
Afterwards you will know which process to kill
There are several options:
There is more info in
/proc/<pid>
on Linux, just have a look.On other Unixes things might be different. The
ps
command will work everywhere, the/proc
stuff is OS specific. For example on AIX there is nocmdline
in/proc
.You can use
pgrep
with-f
(full command line) and-l
(long description):This method has a crucial difference with any of the other responses: it works on CygWin, so you can use it to obtain the full command line of any process running under Windows (execute as elevated if you want data about any elevated/admin process). Any other method for doing this on Windows is more awkward, for example.
Furthermore: in my tests, the pgrep way has been the only system that worked to obtain the full path for scripts running inside CygWin's python.
On Linux, with bash, to output as quoted args so you can edit the command and rerun it
On Solaris, with bash (tested with 3.2.51(1)-release) and without gnu userland:
Linux bash Example (paste in terminal):
Output:
Solaris Bash Example:
Output:
You can simply use:
This will do the trick:
Without the xargs, there will be no spaces between the arguments, because they have been converted to NULs.