Module 11 Flashcards

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
Q

What does the top command do?

A

Continuously displays real-time information about all processes.

26
Q

What is the htop command?

A

An interactive version of top for managing processes.

27
Q

What does the pidof command do?

A

Returns the PID of a specified process.

28
Q

What is a signal in Unix?

A

A communication tool used to notify processes about events.

29
Q

Which signal is used to end a session?

A

SIGHUP (signal number 1).

30
Q

What does the SIGINT signal do?

A

Interrupts a process, typically triggered by CTRL+C.

31
Q

What is the default nice value assigned to processes in Linux?

A

The default nice value is 0.

32
Q

What happens when you run find / -name core -exec rm -f {} \; &?

A

It searches for files named “core” throughout the system and deletes them, running the command in the background.

33
Q

What does the TIME field in the ps output represent?

A

It shows the cumulative execution time of the process.

34
Q

What is a Teletype (TTY) as shown in ps output?

A

It refers to the controlling terminal of the process.

35
Q

How do you identify the owner of a process?

A

By looking at the UID field in the ps output.

36
Q

What is the purpose of pgrep -u <username> <process_name>?</process_name></username>

A

Searches for processes owned by a specific user and matches the given process name.

37
Q

How can you view the status of a specific process using its PID?

A

Use ps <PID> or ps -p <PID>.</PID></PID>

38
Q

What are the characteristics of a non-interruptible sleep state (D) in process status?

A

The process is waiting for I/O operations, such as disk access, and cannot be interrupted.

39
Q

What does kill -9 <PID> specifically do?</PID>

A

It forcefully terminates a process by sending the SIGKILL signal, which cannot be ignored.

40
Q

What happens when a non-root user tries to kill a system process?

A

The operation is denied because system processes can only be terminated by the root user.

41
Q

What is the command to kill multiple processes at once using PIDs?

A

kill <PID1> <PID2> <PID3> or kill -9 <PID1> <PID2> <PID3>.</PID3></PID2></PID1></PID3></PID2></PID1>

42
Q

What is the function of the renice command?

A

It modifies the priority (niceness value) of an already running process.

43
Q

What is the difference between ps aux and ps -ef?

A
  • 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
Q

What is the fg command used for?

A

To bring a background or stopped process to the foreground.

45
Q

What is the bg command used for?

A

To resume a suspended process in the background.

46
Q

What does the jobs command show?

A

It lists background processes and suspended jobs.

47
Q

Why are Zombie processes problematic?

A

They consume resources since their termination is not properly handled by the parent process.

48
Q

What does the SIGFPE signal represent?

A

A floating-point exception error.