Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get the proceses of the actual terminal which are blocked, running, or ready for execution. I cant figure out to use ps or top... Can someone tell where to get that info from?

share|improve this question

migrated from stackoverflow.com Sep 24 '12 at 19:59

This question came from our site for professional and enthusiast programmers.

    
by "terminal" you mean the window (xterm/rxvt/kterm/etc.)? Or the shell that's running in that window (or remote session)? Actual TTY's/PTY's don't use a process. – Jon Lin Sep 24 '12 at 18:40
terminal="konsole"
 ps auwx|grep $terminal|grep -v "grep"|awk '{print $NF ": PID:" $2 " CPU USED:" $3 " MEM USED:" $4 }'
/usr/bin/konsole: PID:3550 CPU USED:0.0 MEM USED:0.7


 terminal="terminator"
 ps auwx|grep $terminal|grep -v "grep"|awk '{print $NF ": PID:" $2 " CPU USED:" $3 " MEM USED:" $4 }'
/usr/bin/terminator: PID:3616 CPU USED:0.7 MEM USED:0.7
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.