Module 11 Flashcards

(48 cards)

1
Q

What is a process in an operating system?

A

A process is a running program with associated information such as Process Identifier (PID), scheduling priority, memory context, file descriptors, and security references.

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

What are the different process statuses?

A
  • R: Running or ready to run.
  • S: Sleeping (waiting for an event).
  • T: Traced or stopped.
  • D: Non-interruptible sleeping (waiting for I/O).
  • Z: Zombie (terminated but not cleaned up).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which command is used to display information about all running processes?

A

ps -A or ps -ef.

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

What does the ps -f command display?

A

It shows processes in full-format, with detailed information like UID, PID, PPID, CPU usage, start time, and command name.

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

What does the ps aux command provide?

A

It displays processes from all users, with user/owner information and processes not started from a terminal.

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

What is a PID?

A

Process Identifier, a unique number assigned to each process.

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

What is a PPID?

A

The Parent Process Identifier, indicating the parent process of a given process.

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

What does the CMD column in the ps output represent?

A

The command that started the process, including its name, options, and arguments.

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

What is the difference between foreground and background processes?

A

Foreground processes require user input and run visibly, while background processes do not require user interaction and run in the background.

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

What command is used to terminate a process using its PID?

A

kill <PID>.</PID>

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

What does the killall command do?

A

Terminates all processes with a specified name.

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

What is the default signal sent by the kill command?

A

SIGTERM (signal number 15).

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

What signal is used for forced termination?

A

SIGKILL (signal number 9).

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

What is a Zombie process?

A

: A terminated process that has not been cleaned up by its parent process.

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

How do you suspend a foreground job?

A

Press CTRL+Z.

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

Which command resumes a suspended job in the background?

A

bg.

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

Which command resumes a suspended job in the foreground?

A

fg.

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

What does the jobs command display?

A

A list of all background and suspended jobs.

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

How do you prioritize processes using niceness values?

A

By using the nice or renice commands.

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

What is the syntax to start a process with a specific niceness value?

A

nice -n <nice_value> <command></command>.</nice_value>

21
Q

What is the range of niceness values?

A

From -20 (highest priority) to 19 (lowest priority).

22
Q

How do you change the niceness value of a running process?

A

renice <nice_value> -p <PID>.</PID></nice_value>

23
Q

What does the pgrep command do?

A

Searches for processes based on their name.

24
Q

How can you combine ps and grep to find a process?

A

ps -ef | grep <process_name>.</process_name>

25
What does the top command do?
Continuously displays real-time information about all processes.
26
What is the htop command?
An interactive version of top for managing processes.
27
What does the pidof command do?
Returns the PID of a specified process.
28
What is a signal in Unix?
A communication tool used to notify processes about events.
29
Which signal is used to end a session?
SIGHUP (signal number 1).
30
What does the SIGINT signal do?
Interrupts a process, typically triggered by CTRL+C.
31
What is the default nice value assigned to processes in Linux?
The default nice value is 0.
32
What happens when you run find / -name core -exec rm -f {} \; &?
It searches for files named “core” throughout the system and deletes them, running the command in the background.
33
What does the TIME field in the ps output represent?
It shows the cumulative execution time of the process.
34
What is a Teletype (TTY) as shown in ps output?
It refers to the controlling terminal of the process.
35
How do you identify the owner of a process?
By looking at the UID field in the ps output.
36
What is the purpose of pgrep -u ?
Searches for processes owned by a specific user and matches the given process name.
37
How can you view the status of a specific process using its PID?
Use ps or ps -p .
38
What are the characteristics of a non-interruptible sleep state (D) in process status?
The process is waiting for I/O operations, such as disk access, and cannot be interrupted.
39
What does kill -9 specifically do?
It forcefully terminates a process by sending the SIGKILL signal, which cannot be ignored.
40
What happens when a non-root user tries to kill a system process?
The operation is denied because system processes can only be terminated by the root user.
41
What is the command to kill multiple processes at once using PIDs?
kill or kill -9 .
42
What is the function of the renice command?
It modifies the priority (niceness value) of an already running process.
43
What is the difference between ps aux and ps -ef?
* ps aux includes processes without a terminal and shows the user column. * ps -ef lists all processes in a full format with additional details like PPID.
44
What is the fg command used for?
To bring a background or stopped process to the foreground.
45
What is the bg command used for?
To resume a suspended process in the background.
46
What does the jobs command show?
It lists background processes and suspended jobs.
47
Why are Zombie processes problematic?
They consume resources since their termination is not properly handled by the parent process.
48
What does the SIGFPE signal represent?
A floating-point exception error.