Process management Flashcards

1
Q

List all processes running on the system
List tree view of all processes running on the system
List processes showing status of processes

A

ps -aux
ps -efH
ps -el

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Find process by name, also show its pid

A

pgrep -l httpd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Kill process matching specified name

A

pkill httpd

killall httpd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Show all process names running by specific user

A

pgrep -u user -l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Kill process with exact specified name

A

pkill -x vi

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Find all processes not own by specified user

A

pgrep -v -u user -l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

List all kill signals

A

kill -l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Most useful signals

A
  1. kill -1 or kill SIGHUP- hangup of controlling terminal
    Same as to closing terminal window on the right upper corner
  2. kill -2 or kill SIGINT -interruption from keyboard. Same as pressing Ctrl+C
  3. kill -15/kill -SIGTERM
    Default signal when killing a processes
  4. kill -9/ kill -SIGKILL - kill process immediately
  5. kill -18/ kill -SIGCONT
    kill -19/ kill -SIGSTOP
    SIGSTOP is the same as Ctrl-Z
    stop the process
    When SIGSTOP is sent to a process, the usual behaviour is to pause that process in its current state. The process will only resume execution if it is sent the SIGCONT signal. SIGSTOP and SIGCONT are used for job control in the Unix shell
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Kill a terminal running by specified user

A
  1. w
    find terminal using by specified user
  2. pkill -t pts/1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Set priority of the process

A

nice [from -20 to 19]
nice -n 10 ping google.com
nice -n 1 httpd
(The higher the number the lower the priority)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Change priority of the process

A

renice -n 5 -p 1234

renice -n 10 $(pgrep httpd)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

CPU info in pseudo fs

A

cat /proc/cpuinfo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly