:title:Processes and Performance Managing |
:date:2016-04-5 |
top
shows top usage per Processps
list all process of current user &
shell
ps -U user
list all processes of user X
ps -U user -u
all user processes with
CPU/MEM
ps -x
show all running processes
ps -xl
show long listing of processes
ps -xo ppid,user,nice,cputime,args
restricting
columns to display
NOTE: ps output can be restricted to some columns only if necessary.
pstree
shows processes alphabetically in tree
formatpgrep init
ps -p $(pgrep firefox)
renice -5 $(pgrep firefox)
$ vmstat 3 redisplay every 3 seconds
$ vmstat 3 -o 5 display output five times every 3 seconds
Example output:
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
2 0 0 180732 182988 1094528 0 0 30 22 321 404 10 3 87 0
free
kill 3000 Send SIGTERM to process with PID 3000
kill -9 12 Send SIGKILL to process with PID 12
killall -SIGHUP sendmail have sendmail process reread config file
---------------------------------------------------------------
Signal Value Action Comment
---------------------------------------------------------------
SIGHUP 1 Term Hangup detected on controlling terminal
or death of controlling process
SIGINT 2 Term Interrupt from keyboard
SIGQUIT 3 Core Quit from keyboard
SIGILL 4 Core Illegal Instruction
SIGABRT 6 Core Abort signal from abort(3)
SIGFPE 8 Core Floating point exception
SIGKILL 9 Term Kill signal
SIGSEGV 11 Core Invalid memory reference
SIGPIPE 13 Term Broken pipe: write to pipe with no
readers
SIGALRM 14 Term Timer signal from alarm(2)
SIGTERM 15 Term Termination signal
SIGUSR1 30,10,16 Term User-defined signal 1
SIGUSR2 31,12,17 Term User-defined signal 2
SIGCHLD 20,17,18 Ign Child stopped or terminated
SIGCONT 19,18,25 Cont Continue if stopped
SIGSTOP 17,19,23 Stop Stop process
SIGTSTP 18,20,24 Stop Stop typed at tty
SIGTTIN 21,21,26 Stop tty input for background process
SIGTTOU 22,22,27 Stop tty output for background process