1
Q

What is a PID in Linux?

A

A unique non-repeating integer assigned to every running program.

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

What is the purpose of PID?

A

Used to allocate CPU time, memory pages, file-descriptor tables, and scheduling priorities.

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

What is PPID?

A

Parent Process ID that identifies the process which spawned the current process.

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

Why is PPID important?

A

Enables tracing of process lineage and understanding of process trees.

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

How can you view PIDs?

A

Using commands like ps aux, ps -eo pid,stat,cmd, top, htop.

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

How to access live kernel statistics for a PID?

A

cat /proc/<PID>/</PID>

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

How to send a signal to a process?

A

kill -9 <PID> or use SIGKILL for forceful termination.</PID>

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

How to change process priority?

A

renice -n 10 -p <PID></PID>

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

How to trace system calls of a process?

A

strace -p <PID></PID>

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

What is PID 1?

A

systemd, the first process started and never exited.

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

What happens if PID 1 is terminated?

A

The system crashes.

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

Do PIDs recycle?

A

Yes, after a process ends.

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

What should you confirm before sending commands to a PID?

A

Confirm the current PID.

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

How to view process hierarchy?

A

ps -e –forest -o pid,ppid,cmd or pstree -p.

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

What happens if you stop a parent process?

A

It affects all its child processes.

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

How to kill a parent process and its children?

A

kill <PPID>, pkill -P <PPID> <signal>, or systemctl kill --kill-who=all <service>.service.</service></signal></PPID></PPID>

17
Q

What are orphaned processes?

A

Processes whose parent has terminated; they are adopted by PID 1.

18
Q

What are zombie processes?

A

Defunct processes not reaped by parent.

19
Q

What does reaping mean?

A

Parent performs a wait operation to free child’s resources and remove its entry from the process table.