I want to run pstree
on a set of pid which I find using ps
ps -aux | grep ^username | awk '{pstree $2}'
Unfortunately, the output is empty, but if I run the pstree
command manually with the same pids I get the desired output. What is wrong with the awk
command? Or how do I achieve the desired result by other means?