Full command not visible using ps in solaris Full command not visible using ps in solaris unix unix

Full command not visible using ps in solaris


You may use in Solaris:

pargs -l PID

to get all arguments of process in one line if you know its PID. Also you may get the particular argument of process in such way:

pargs -a PID | grep 'argv\[8\]' | cut -d: -f 2 

Or you may use ps with options if you know only one of process arguments:

/usr/bin/ps -A -o pid,args | grep connectivity_script.sh | grep -v grep

In older Solaris versions ouput of arguments in /usr/bin/ps is limited with 80 chars, so you need two-steps to do: 1) get PID from ps, 2) get full args from pargs.

PID=$(/usr/bin/ps -A -o pid,args | \      grep connectivity_script.sh | \      grep -v grep | \      cut -d" " -f 1 )pargs -l $PID


As Sasha says, pargs is the best (and only, on older versions of Solaris) way to look at a process's entire argument vector, but pgrep is the best way to find the process in the first place. Because the thing you're searching for is not the name of the executable, you'll need the -f argument. Thus:

pgrep -f connectivity_script.sh

Combining with pargs:

pargs $(pgrep -f connectivity_script.sh)

Note that unless you own the process or have elevated privilege, you won't be able to see the entire argument vector of a process, and so the pgrep invocation may fail to find what you're looking for, and pargs definitely won't show it. That limitation is present even in the newer versions of Solaris Andrew mentioned.