Pages

Ads 468x60px

Monday, July 23, 2012

Linux: Process Management Commands

This lab will help you to learn commands for process management.


•   Start a foreground process, move it to the background and kill it using PID.
Ans. Lets suppose we have 2 files opened in gedit
        $fg %2
        $bg %1
        $kill process_id(1793 etc.)

•   List  all  the  current  running  processes  owned  by  the  current  user  in  user  oriented format.
Ans. $ps -u user_name

•   List only running processes in tree mode.
Ans. $pstree -u user_name

•   Run  a  background  process  from  your  shell  that  finds  a  file  named  cpuinfo,  with lowest possible priority.
Ans. $nice 20 | find /* -name "cpuinfo"&

•   List  priority  value  of  all  running  processes  in  your  system.  Now  reduce  the  priority value of any running process by 5. Compare the new and the old priority values.
Ans. $renice -5 -p process_id(1793 etc.)

No comments:

Post a Comment