Hi AllenMcw,
WRT ps command output, what I indicated that you did not provide is the
column headers from the ps command output. Your use of the grep command excluded the
column headers from the ps command output.
If you believe that your original post shows 2 tcpdump processes, then you are mistaken. It does not show two
tcpdump processes. What it shows is one
/bin/sh process and one
tcpdump process. If I tell the shell
/bin/sh to run a simple sleep command in the background and further to run it in a sub-shell by running this command:
Code:
/bin/sh -c '(sleep 60)' &
and on my system I then use the
egrep command in a way that allows me to get the lines of ps command output that contain
sleep 60 and also get me the ps command output
column headers it looks like this:
Code:
UID PID PPID C STIME TTY TIME CMD
root 14052 4009 0 04:11 pts/1 00:00:00 /bin/sh -c (sleep 60)
root 14055 14052 0 04:11 pts/1 00:00:00 sleep 60
root 14061 4009 0 04:12 pts/1 00:00:00 egrep --color=auto (PID)|(sleep 60)
but that ps command output does
not show 3
sleep processes running, and it does
not show 2 sleep processes running. It shows one
/bin/sh process running, one
sleep process running and one
egrep process running.
HTH.