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?

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
| improve this answer | |
  • Well, it does not show me, if any new process is started, does it? – Adam Hunyadi Nov 30 '16 at 12:32
  • @AdamHunyadi Yes, you are right, maybe delay option help you, I updated ans. – Mustafa DOGRU Nov 30 '16 at 12:39
  • -d only refreshes the htop call, but the process list remains the same. – Adam Hunyadi Nov 30 '16 at 12:48
  • @AdamHunyadi ; I updated ans. maybe this can help you. – Mustafa DOGRU Nov 30 '16 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.