Linux: View and manage processes running in the background
by Ali on Jun.14, 2009, under Linux
To view all processes:
ps aux
Search for a process by name:
pgrep <string> | xargs ps
To view all processes, line by line (hit enter to view the next process, hit q to exit):
ps aux | less
To view every process:
ps -A or ps -e
All processes running by a user:
ps -u username
All processes except the ones running by root:
ps -U root -u root -N
To kill a process, either find the process name and type:
kill -9 processname
or kill the process ID (PID):
kill pid
Stop/suspend a process:
ctrl-z
Push a job to run in the background:
fg pid
To the extent possible under law, the creator has waived all copyright and related or neighboring rights to this work.
May 22nd, 2011 on 1:07 AM
I think the last command is to bring back the process to foreground
November 24th, 2011 on 7:56 AM
thank you for this useful codes