Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.
A process is an instance of a program that is currently being executed by the operating system.
Question 2 of 60 · Concept of Processes · Easy
Which of the following best describes the difference between a program and a process?
Not quite. Try another option.
Answer: A program is a passive set of instructions, while a process is an active execution of those instructions managed by the operating system with its own resources
A program is static code on disk, whereas a process is that program actively running with allocated resources.
Question 3 of 60 · Process ID (PID) · Easy
What does PID stand for?
Not quite. Try another option.
Answer: Process Identifier
PID stands for Process Identifier, a unique number assigned to each running process.
Question 4 of 60 · Process ID (PID) · Easy
Which statement about a Process ID (PID) is correct?
Not quite. Try another option.
Answer: Each running process is assigned a unique PID
The operating system assigns a unique PID to every running process to identify it.
Question 5 of 60 · Process ID (PID) · Easy
In Linux, which process is traditionally assigned the PID of 1?
Not quite. Try another option.
Answer: init/systemd
PID 1 is the first process started at boot, traditionally init and now often systemd.
Question 6 of 60 · ps · Easy
What is the primary purpose of the ps command?
Not quite. Try another option.
Answer: To display information about currently running processes
The ps command shows a snapshot of the current processes running on the system.
Question 7 of 60 · ps · Easy
Which command displays a snapshot of processes at the moment it is run, rather than updating continuously?
Not quite. Try another option.
Answer: ps
ps gives a one-time static snapshot, unlike top which refreshes in real time.
Question 8 of 60 · ps · Easy
Which ps option combination is commonly used to display all processes on the system with full details?
Not quite. Try another option.
Answer: ps aux
ps aux is a widely used command to list all running processes with detailed information.
Question 9 of 60 · top · Easy
What does the top command do?
Not quite. Try another option.
Answer: Displays a real-time, continuously updating view of running processes and system resource usage such as CPU and memory
top provides a live, refreshing display of processes along with CPU and memory statistics.
Question 10 of 60 · top · Easy
Which key is commonly pressed to quit the top command?
Not quite. Try another option.
Answer: q
Pressing q exits the interactive top display and returns to the shell.
Question 11 of 60 · top · Easy
The top command is mainly used to monitor which of the following?
Not quite. Try another option.
Answer: System resource usage and active processes
top continuously monitors CPU, memory, and the processes consuming system resources.
Question 12 of 60 · jobs · Easy
What does the jobs command display?
Not quite. Try another option.
Answer: Jobs started from the current shell that are running or stopped in the background
The jobs command lists the background and stopped jobs associated with the current shell session.
Question 13 of 60 · jobs · Easy
In the shell, a job typically refers to which of the following?
Not quite. Try another option.
Answer: A process or group of processes started from the shell
A job is a command or pipeline of processes launched and tracked by the shell.
Question 14 of 60 · bg · Easy
What does the bg command do?
Not quite. Try another option.
Answer: Resumes a suspended job and runs it in the background
The bg command continues a stopped job, letting it run in the background.
Question 15 of 60 · bg · Easy
Which key combination is typically used to suspend a foreground job before sending it to the background with bg?
Not quite. Try another option.
Answer: Ctrl + Z
Pressing Ctrl + Z suspends the current foreground job, which can then be resumed with bg.
Question 16 of 60 · fg · Easy
What is the purpose of the fg command?
Not quite. Try another option.
Answer: Brings a background or suspended job to the foreground
The fg command moves a background or stopped job into the foreground so it runs interactively.
Question 17 of 60 · fg · Easy
If you have a job running in the background and want to interact with it directly in the terminal, which command should you use?
Not quite. Try another option.
Answer: fg
fg brings the job to the foreground, allowing direct interaction in the terminal.
Question 18 of 60 · kill · Easy
What is the main purpose of the kill command?
Not quite. Try another option.
Answer: To send a signal to a process, commonly to terminate it
The kill command sends a signal (by default the termination signal) to a process identified by its PID.
Question 19 of 60 · kill · Easy
The kill command identifies which process to signal by using its __.
Not quite. Try another option.
Answer: PID
kill requires the Process ID (PID) to specify which process should receive the signal.
Question 20 of 60 · pkill · Easy
How does pkill differ from kill?
Not quite. Try another option.
Answer: pkill lets you terminate processes by name or other attributes instead of requiring a specific PID like kill does
pkill matches processes by name or pattern, while kill typically requires the numeric PID.
Question 21 of 60 · Concept of Processes · Medium
A running program creates a child process using fork(). Which statement best describes the relationship between the two processes immediately after fork() returns?
Not quite. Try another option.
Answer: The child is an exact copy of the parent with a separate address space
fork() creates a new process that is a duplicate of the parent, but each has its own independent address space (copy-on-write in practice).
Question 22 of 60 · Concept of Processes · Medium
A process that has finished execution but still has an entry in the process table because its parent has not read its exit status is called a:
Not quite. Try another option.
Answer: Zombie process
A zombie (defunct) process has terminated but retains a process table entry until the parent calls wait() to reap its exit status.
Question 23 of 60 · Concept of Processes · Medium
A child process continues running after its parent terminates. Which process typically adopts this orphaned child on a modern Linux system?
Not quite. Try another option.
Answer: The init/systemd process (PID 1)
Orphaned processes are re-parented to init or systemd (PID 1), which reaps them when they terminate.
Question 24 of 60 · Process ID (PID) · Medium
Which command displays the PID of the currently running shell?
Not quite. Try another option.
Answer: echo $$
The special variable $$ holds the PID of the current shell. $! is the last background PID, $? is the last exit status, and $# is the argument count.
Question 25 of 60 · Process ID (PID) · Medium
After launching a command in the background with &, which shell variable holds the PID of that most recently backgrounded process?
Not quite. Try another option.
Answer: $!
$! expands to the PID of the most recent background (asynchronous) command, useful for later monitoring or termination.
Question 26 of 60 · Process ID (PID) · Medium
On a standard Linux system, which process always has a PID of 1?
Not quite. Try another option.
Answer: The init/systemd process
PID 1 is reserved for the first user-space process, init (or systemd), which is the ancestor of all other processes.
Question 27 of 60 · ps · Medium
Which ps command lists every process on the system with detailed information in the BSD-style format?
Not quite. Try another option.
Answer: ps aux
ps aux uses BSD syntax to show all processes (a, x) from all users with detailed output (u), including CPU and memory usage.
Question 28 of 60 · ps · Medium
You want to find the PID of a process named nginx using ps. Which pipeline achieves this?
Not quite. Try another option.
Answer: ps -ef | grep nginx
ps -ef lists all processes in full format; piping to grep nginx filters lines matching the process name to reveal its PID.
Question 29 of 60 · ps · Medium
In the output of ps -ef, which column shows the parent process ID of each listed process?
Not quite. Try another option.
Answer: PPID
PPID (Parent Process ID) identifies the process that spawned the current one; PID is the process's own ID.
Question 30 of 60 · top · Medium
While top is running interactively, which key sorts the process list by memory usage?
Not quite. Try another option.
Answer: M
In top, pressing M sorts by memory usage, P sorts by CPU usage, k kills a process, and q quits.
Question 31 of 60 · top · Medium
The load average shown in top reports three numbers. What do these three values represent?
Not quite. Try another option.
Answer: Average load over the last 1, 5, and 15 minutes
The load average triplet reflects the system run-queue demand averaged over the last 1, 5, and 15 minutes respectively.
Question 32 of 60 · top · Medium
In top, a process shows a state of R in the status column. What does this indicate?
Not quite. Try another option.
Answer: The process is running or runnable
State R means running or ready to run. S is sleeping, D is uninterruptible sleep, T is stopped, and Z is zombie.
Question 33 of 60 · jobs · Medium
You run jobs and see [2]+ Stopped vim file.txt. What does the + symbol next to the job number indicate?
Not quite. Try another option.
Answer: It is the current (default) job for fg/bg
The + marks the current job, which fg and bg act on by default; - marks the previous job.
Question 34 of 60 · jobs · Medium
Which command lists the active jobs of the current shell along with their PIDs?
Not quite. Try another option.
Answer: jobs -l
jobs -l lists jobs together with their PIDs. jobs -p shows only PIDs, jobs -r shows running jobs, and jobs -s shows stopped jobs.
Question 35 of 60 · bg · Medium
You pressed Ctrl+Z to suspend a long-running command. Which command resumes it in the background so the terminal is freed?
Not quite. Try another option.
Answer: bg
bg resumes the most recently stopped job in the background, sending it a SIGCONT while keeping the terminal available.
Question 36 of 60 · bg · Medium
You have two stopped jobs [1] and [2]. Which command resumes job 1 specifically in the background?
Not quite. Try another option.
Answer: bg %1
Job control references jobs with a % prefix, so bg %1 resumes job number 1 in the background.
Question 37 of 60 · fg · Medium
A command is running in the background and you want to bring it back to the foreground to interact with it. Which command does this?
Not quite. Try another option.
Answer: fg
fg moves a background or stopped job to the foreground, reconnecting it to the terminal's standard input.
Question 38 of 60 · kill · Medium
A process ignores the default kill signal. Which command forcibly and unconditionally terminates the process with PID 4521?
Not quite. Try another option.
Answer: kill -9 4521
Signal 9 (SIGKILL) cannot be caught or ignored and forcibly ends the process. Signal 15 (SIGTERM) is the default and can be handled.
Question 39 of 60 · kill · Medium
Which signal number does the kill command send by default when no signal is specified?
Not quite. Try another option.
Answer: 15 (SIGTERM)
By default kill sends SIGTERM (15), a polite request to terminate that a process may catch to clean up before exiting.
Question 40 of 60 · pkill · Medium
Which command terminates all running processes whose name matches firefox in a single step?
Not quite. Try another option.
Answer: pkill firefox
pkill matches processes by name and signals them directly, so pkill firefox sends SIGTERM to every matching process at once.
Question 41 of 60 · kill · Hard
A process ignores SIGTERM because it has installed a custom handler that only logs the signal. Which signal number should you send to force termination that the process cannot catch, block, or ignore?
Not quite. Try another option.
Answer: Signal 9 (SIGKILL)
SIGKILL (9) and SIGSTOP (19) are the only signals that cannot be caught, blocked, or ignored by a process. SIGTERM, SIGINT, and SIGHUP can all be trapped by custom handlers.
Question 42 of 60 · Concept of Processes · Hard
A process calls fork() which returns 0 in one context and a positive integer in another. What do these two return values indicate respectively?
Not quite. Try another option.
Answer: 0 is returned to the child; the positive value (child's PID) is returned to the parent
fork() returns 0 in the child process so it can identify itself, and returns the child's PID (a positive integer) to the parent so the parent can track it. A return of -1 indicates failure.
Question 43 of 60 · Process ID (PID) · Hard
A parent process terminates before its child completes. Which process becomes the new parent of the orphaned child, and what is that process's typical PID?
Not quite. Try another option.
Answer: init/systemd with PID 1 adopts the orphan
Orphaned processes are re-parented to init (or systemd), which always runs with PID 1. This process reaps the orphan when it exits, preventing it from becoming a permanent zombie.
Question 44 of 60 · jobs · Hard
You run sleep 100 &, then sleep 200 &, then sleep 300 &. Running jobs shows job [3] marked with a +. What does the + sign specifically denote?
Not quite. Try another option.
Answer: The current (default) job that fg and bg act on when no job spec is given
In jobs output, + marks the current job (the default target for fg/bg), and - marks the previous job. The current job is typically the most recently backgrounded or stopped one.
Question 45 of 60 · pkill · Hard
You run pkill -9 -f "python.*server". Which processes are targeted for SIGKILL?
Not quite. Try another option.
Answer: Processes whose full command line matches the regex python.*server
The -f flag makes pkill match against the full command line (including arguments) rather than just the process name. Without -f, only the 15-character process name is matched.
Question 46 of 60 · bg · Hard
A foreground process is stopped with Ctrl+Z. You then run bg. What is the sequence of signals delivered that resumes the job in the background?
Not quite. Try another option.
Answer: Ctrl+Z sends SIGTSTP; bg sends SIGCONT to resume it in the background
Ctrl+Z sends SIGTSTP (terminal stop, which can be caught), stopping the job. bg sends SIGCONT to resume execution, but keeps the job detached from the terminal's foreground.
Question 47 of 60 · top · Hard
In top, a process shows %CPU of 150.0 on a 4-core system. How is this value possible and what does it indicate?
Not quite. Try another option.
Answer: It is a multi-threaded process using 1.5 cores; top sums usage across cores (max would be 400%)
By default top shows CPU usage summed across all cores, so a multi-threaded process can exceed 100%. On a 4-core system the theoretical maximum is 400%. Press Shift+I (Irix mode toggle) to switch to per-core normalized values.
Question 48 of 60 · ps · Hard
Which ps command reliably lists processes sorted by memory usage in descending order, showing the top memory consumers?
Not quite. Try another option.
Answer: ps aux --sort=-%mem
The --sort option accepts a key with a - prefix for descending order. --sort=-%mem sorts by memory usage highest-first. Without the -, it sorts ascending. --order and --memsort are not valid ps options.
Question 49 of 60 · kill · Hard
A defunct (zombie) process appears in ps output. Why does kill -9 <PID> fail to remove it?
Not quite. Try another option.
Answer: A zombie is already dead; only its parent reaping it via wait() clears the entry
A zombie has already terminated; it only exists as an entry in the process table awaiting its parent to read its exit status via wait(). Signals have no effect on a dead process. Killing the parent lets init reap the zombie.
Question 50 of 60 · fg · Hard
You have jobs [1], [2], and [3] in the background. Which command brings job 2 specifically to the foreground?
Not quite. Try another option.
Answer: fg %2
Job specifications use the % prefix, so fg %2 targets job number 2. fg 2 would be interpreted as a PID argument in some shells and generally fails as a job reference; #2 and -2 are invalid job specs.
Question 51 of 60 · pkill · Hard
What is the key behavioral difference between pkill firefox and killall firefox?
Not quite. Try another option.
Answer: pkill matches process names as a substring/pattern by default; killall requires an exact name match
pkill treats its argument as a pattern that matches partial process names, while killall requires the exact process name. Both send SIGTERM by default. This substring matching makes pkill more prone to unintended matches.
Question 52 of 60 · Concept of Processes · Hard
A process in the D state shown by ps cannot be terminated even with SIGKILL. What does the D state represent?
Not quite. Try another option.
Answer: Uninterruptible sleep, typically blocked on I/O; the process cannot handle signals until the operation completes
The D state is uninterruptible sleep, usually waiting on disk or network I/O. The process cannot process any signals (including SIGKILL) until the I/O completes. Persistent D states often signal hardware or filesystem problems.
Question 53 of 60 · Process ID (PID) · Hard
In a shell, $$ expands to 4821 and $! expands to 4835. What do these two variables represent?
Not quite. Try another option.
Answer: $$ is the current shell's PID; $! is the PID of the most recent background process
$$ holds the PID of the current shell, while $! holds the PID of the last process started in the background with &. These are commonly used in scripts to track and manage child processes.
Question 54 of 60 · top · Hard
In top, the summary line shows %wa (iowait) at 45% while %us and %sy are low. What does this most likely indicate?
Not quite. Try another option.
Answer: The CPU is idle but waiting on slow I/O operations, indicating an I/O bottleneck rather than CPU saturation
High %wa (iowait) means the CPU has capacity but is idle while waiting for I/O (disk/network) to complete. This points to an I/O bottleneck, not a CPU shortage. Low %us/%sy confirms the CPU itself is not the constraint.
Question 55 of 60 · ps · Hard
What does the STAT column value Ss mean in the output of ps aux?
Not quite. Try another option.
Answer: S = interruptible sleep; s = the process is a session leader
The first character is the primary state (S = interruptible sleep). Additional characters are modifiers: s marks a session leader, + a foreground-group process, l multi-threaded, and < high priority.
Question 56 of 60 · kill · Hard
Running kill -0 <PID> produces no output and returns exit status 0. What is the purpose of signal 0?
Not quite. Try another option.
Answer: It checks whether the process exists and is signalable, without actually sending any signal
Signal 0 is a special no-op used to test for process existence and permission to signal it. If the process exists and you have permission, kill returns 0; otherwise it returns an error. No actual signal is delivered.
Question 57 of 60 · bg · Hard
A backgrounded job (via bg) attempts to read from the terminal (stdin). What happens to the job?
Not quite. Try another option.
Answer: It is stopped with SIGTTIN and appears as stopped in jobs until brought to the foreground
A background job that tries to read from the controlling terminal receives SIGTTIN, which stops it. The user must bring it to the foreground with fg to supply input. Terminal output can similarly trigger SIGTTOU depending on settings.
Question 58 of 60 · pkill · Hard
You want to send SIGTERM only to processes named nginx owned by user www-data. Which command is correct?
Not quite. Try another option.
Answer: pkill -u www-data nginx
The -u option restricts matches to processes owned by the effective user ID of the given user, and nginx is the name pattern. --owner is not a valid option, and the argument order in the other choices is incorrect.
Question 59 of 60 · jobs · Hard
After running jobs -l, what additional information is shown compared to plain jobs?
Not quite. Try another option.
Answer: The PID of each job is displayed alongside the job number and state
The -l (long) flag adds the PID of each job to the standard jobs output. This is useful for correlating shell job numbers with system-level PIDs seen in ps or top.
Question 60 of 60 · Concept of Processes · Hard
A daemon process is created by double-forking. Why is the secondfork() performed after the first child calls setsid()?
Not quite. Try another option.
Answer: To ensure the daemon is not a session leader, so it can never reacquire a controlling terminal
After setsid() the first child becomes a session leader, which could acquire a controlling terminal. The second fork() produces a grandchild that is not a session leader, guaranteeing the daemon can never obtain a controlling terminal.
That's unit 8
Answer a few questions and your score shows up here.
Nearly through. Did unit 8 of CSE105 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 8 of CSE105 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill;
the rest comes out of a student's own pocket: the domain, the storage, and keeping
the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.