1

Version:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:        20.04
Codename:       focal

When i check my process' with htop or ps aux i cant see the rest of my command after first pipe

command i run is :

ping -i 0.5 4.2.2.4 | while read row; do awk '{ $1=strftime("%Y-%m-%d %H:%M:%S",substr($0,2,10));print $0}' <<< $row;done | grep 'no answer' | tee log.txt > log_store.txt

and ps aux output is:

UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 Mar20 ?        00:00:00 /lib/systemd/systemd
root        23     1  0 Mar20 ?        00:00:01 /lib/systemd/systemd-journald
root        25     1  0 Mar20 ?        00:00:00 /usr/sbin/cron -f
root        28     1  0 Mar20 ?        00:00:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
root        31    30  0 Mar20 ?        00:00:24 ping -i 0.5 4.2.2.4  <--------------

As can be seen only ping portion up to first pipe is shown, is there a way to see rest somehow ?

3
  • thanks if thats the case it makes sense. but is there a way to see how a process is called at first place? I tried to look from pid/cmdline but no luck Commented Mar 21, 2022 at 9:07
  • 1
    You are seeing how each process was called. Seeing the shell command that constructed the pipeline is only known to that shell. It may (for example) be wildly different to the original text because it has been through multiple expansions and substitutions. Commented Mar 21, 2022 at 9:15
  • Thank you @Paul_Pedant, that explains lot Commented Mar 21, 2022 at 9:16

1 Answer 1

3

you've pipe ping to 3 subsequent process ( awk , grep and tee ), thoses process should appear somewhere on ps aux 's output.

  1. note that bash syntax (in this case while loop ) do not appear in ps's output as it is internal to bash.

  2. ps -ef -H (-H as Hierachy) might be a better choice than ps aux.

1
  • that's perfect thanks Commented Mar 21, 2022 at 10:02

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.