sudo ps o gpid,comm reports something like
3029 bash but the command has parameters
--arbitrary -other -searchword is there a way to display these arguments?
Rather than formatting the output of
ps and then using
grep, you can simply use
pgrep -a bash
This will show the command name (
bash) along with its arguments (if any).
man pgrep :
-a, --list-full List the full command line as well as the process ID.
Actually, you don't have to grep anything when using
ps (at least the procps-ng implementation typically found on GNU/Linux systems, or the HP-UX
ps), run this:
ps -o args= -C bash
If the list of arguments is very long, you may throw in a couple of
-w options (though not on HP-UX):
ps -wwo args= -C bash
The following command:
sudo ps o gpid,comm,args
3029 bash bash --arbitrary -other -searchword