Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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