0

Is there a way to only list processes of given users in htop? I know that I can select a single user by using htop -u USERNAME, but is there a way to select more than a one person?

1

1 Answer 1

0

Maybe this could help you; First get processid with ps command with u option then, use htop -p commands as below;

#!/bin/bash
n=0; 
while (( n++ < 3 )); do 
{ sleep 3; killall htop;}&
htop -p $(ps -u root -u youruser  | awk 'BEGIN{ORS=","} {print $1}') 
done
4
  • Well, it does not show me, if any new process is started, does it? Nov 30, 2016 at 12:32
  • @AdamHunyadi Yes, you are right, maybe delay option help you, I updated ans. Nov 30, 2016 at 12:39
  • -d only refreshes the htop call, but the process list remains the same. Nov 30, 2016 at 12:48
  • @AdamHunyadi ; I updated ans. maybe this can help you. Nov 30, 2016 at 13:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .