I wanted to know if I can execute a command from the terminal and right after the command started I send its PID to another command to be monitored.
I need to do something like this,
dd if=/path/of/file of=/path/of/destination
And then I need to monitor its execution using pidstat
, but pidstat
takes a pid and I don't know how to make one send the pid to the other.
I need to monitor disk usage, memory usage, cpu usage and time elapsed. Does any one know of a way to do that?