ps command: how show the complete command with options, pipes and redirection? (or all together)
About the ps
command, consider if for simplicity:
- in
tty3
is executed theyes
command - in
tty4
is executed theyes > /dev/null
command
through ps
I need to show in the report the complete command with options, pipes and redirection, in this case redirection, was tried ps aux
and ps -ef
and does not appear as expected, for both cases always appear yes
– I need see yes
and yes > /dev/null
... COMMAND
yes
yes > /dev/null
so currently the > /dev/null
part is not included. How accomplish this goal?
About a command with pipe it would be mvn clean ... | tee ...
and about option(s) the command would be tar -xzf /path/to/filename.tar.gz
... COMMAND
mvn clean ... | tee ...
tar -xzf /path/to/filename.tar.gz
or all together: options, pipes and redirection
You can’t. At least, not without deconstructing output from ps
, lsof
, and a little bit of guesswork.
You can use ps -ef
or maybe ps -wwef
to get the command with its options, but redirections and pipes are not part of a command and so will not be shown