Thursday, 5 March 2020

solaris command to show long argument of running process - Examples

In Unix-based operating systems like Solaris, each running process has a set of arguments that are passed to it when it is started. These arguments can include both short and long options, as well as values for those options.

The pargs command in Solaris is used to display the arguments of a running process. By default, it displays the short arguments of the process, but with the -l option, it can be used to display the long arguments as well.

This can be useful for troubleshooting and debugging, as it allows you to see exactly how a process was started and what options and values were passed to it. It can also be used to verify that a process is running with the correct options and values.

In Solaris, you can use the pargs command to display the arguments passed to a running process. The pargs command prints the complete argument list for a process, including the command name and any arguments passed to it.


Here's an example of how to use the pargs command:

First, find the process ID (PID) of the running process whose arguments you want to view using the ps command. For example, to find the PID of a process named myprocess, run:

$ ps -ef | grep myprocess


This will show a list of all processes that match the name myprocess, along with their PIDs.

Once you have the PID of the process, use the pargs command to view its arguments. For example, to view the arguments of a process with PID 1234, run:

$ pargs 1234



This will print the complete argument list for the process, including the command name and any arguments passed to it.

$ pargs 1234 /bin/bash /path/to/script.sh arg1 arg2 arg3



In this example, the pargs command shows that the process with PID 1234 was started with the command /bin/bash and the arguments /path/to/script.sh, arg1, arg2, and arg3.


Labels: , , ,