Processes Questions with Answers

20 practice questions on Processes (Linux & Shell) with answers and step-by-step solutions. Try 10 samples below, then practise all 20 free in the AptiNest app.

Sample questions

Question 1Easy

Which key combination in a terminal normally sends SIGINT to the foreground job?

  1. Ctrl+Z
  2. Ctrl+D
  3. Ctrl+C
  4. Ctrl+S

Answer: C. Ctrl+C

Explanation

Ctrl+C interrupts the foreground process. Ctrl+Z suspends it, and Ctrl+D signals end of input.

Step-by-step solution

  1. The terminal driver maps keys to signals.
  2. Ctrl+C = SIGINT.
  3. Ctrl+Z = SIGTSTP.

Why the other options are wrong

  • A. Ctrl+Z suspends.
  • B. Ctrl+D sends EOF.
  • D. Ctrl+S pauses output.

Question 2Easy

Which command shows a snapshot of all running processes with their owners and CPU use?

  1. jobs
  2. top -k
  3. pstree -c
  4. ps aux

Answer: D. ps aux

Explanation

ps aux lists every process (BSD syntax); ps -ef is the System V equivalent.

Step-by-step solution

  1. Use ps for a snapshot.
  2. aux means all users, with user-oriented format.
  3. top is the live view.

Why the other options are wrong

  • A. jobs shows only shell jobs.
  • B. -k is not a top snapshot option.
  • C. pstree shows the tree and not CPU.

Question 3Easy

Which command finds the PIDs of processes whose name matches nginx?

  1. pgrep nginx
  2. pidof -all nginx*
  3. ps nginx
  4. lookup nginx

Answer: A. pgrep nginx

Explanation

pgrep pattern prints matching PIDs. pkill sends them a signal.

Step-by-step solution

  1. Use pgrep.
  2. It matches process names.
  3. pkill kills them.

Why the other options are wrong

  • B. That is not valid syntax here.
  • C. ps does not take names that way.
  • D. No such command.

Question 4Easy

Which signal does kill 1234 (no option) send?

  1. SIGKILL (9)
  2. SIGINT (2)
  3. SIGSTOP (19)
  4. SIGTERM (15)

Answer: D. SIGTERM (15)

Explanation

SIGTERM asks the process to terminate and can be handled for cleanup. SIGKILL cannot be caught.

Step-by-step solution

  1. No signal named means the default.
  2. The default is SIGTERM.
  3. It is signal 15.

Why the other options are wrong

  • A. Needs -9.
  • B. SIGINT comes from Ctrl+C.
  • C. SIGSTOP pauses.

Question 5Medium

What does the crontab entry 30 2 * * * mean?

  1. Run every 30 minutes at 2 AM only
  2. Run on the 2nd day at 30 hours
  3. Run every day at 02:30
  4. Run every 2 hours at minute 30 on Sundays

Answer: C. Run every day at 02:30

Explanation

Fields are minute, hour, day of month, month, day of week.

Step-by-step solution

  1. Minute field is 30 meaning task runs at 30th minute.
  2. Hour field is 2 meaning task runs at 2 AM.
  3. Day of month, month, and day of week are wildcards so it runs every day.
  4. So the entry runs every day at 02:30.
  5. Final answer: Run every day at 02:30.

Why the other options are wrong

  • A. 30 2 means minute 30 of hour 2, not every 30 minutes; it runs once a day.
  • B. The second field is the hour, so 2 means hour 2; 30 is a minute, not 30 hours.
  • D. The fifth field is day of week and * means every day, so it is not only on Sundays.

Tip: Remember crontab order: min hr dom mon dow.

Question 6Medium

What is the difference between cron and at?

  1. cron runs a job once; at repeats it forever
  2. at needs root privileges; cron does not
  3. cron runs jobs on a repeating schedule; at runs a job once at a given time
  4. They are the same command

Answer: C. cron runs jobs on a repeating schedule; at runs a job once at a given time

Explanation

Recurring tasks go in a crontab; one-off jobs use at.

Step-by-step solution

  1. Cron runs jobs on a repeating schedule.
  2. At runs a job once at a given time.
  3. Cron uses a crontab for scheduling.
  4. At is used for one-time tasks.
  5. The difference is in repetition vs single execution.
  6. Final answer: cron runs jobs on a repeating schedule; at runs a job once at a given time.

Why the other options are wrong

  • A. This is reversed: cron repeats jobs on a schedule, while at runs a job once.
  • B. Neither needs root by default; access for each is controlled by its own allow and deny files.
  • D. They are different commands: cron repeats on a schedule, while at runs one job at a set time.

Tip: Remember: cron for repeats, at for single use.

Question 7Medium

In a bash script, what does $! hold?

  1. The exit status of the last command that finished in the script
  2. The PID of the most recent background command
  3. The PID of the script
  4. The number of arguments

Answer: B. The PID of the most recent background command

Explanation

$$ is the shell's PID, $? the last exit status and $# the argument count.

Step-by-step solution

  1. Start cmd &.
  2. $! stores its PID.
  3. Use wait $! to wait for it.

Why the other options are wrong

  • A. That is $?.
  • C. That is $$.
  • D. That is $#.

Question 8Medium

Which signal does the kernel deliver to a process that accesses invalid memory (a segmentation fault)?

  1. SIGSEGV
  2. SIGPIPE
  3. SIGCHLD
  4. SIGALRM

Answer: A. SIGSEGV

Explanation

A bad memory access raises SIGSEGV, and the default action ends the process and may dump core.

Step-by-step solution

  1. The process reads or writes an address it does not own.
  2. The MMU faults and the kernel sends SIGSEGV.
  3. Default action: terminate (with core dump).

Why the other options are wrong

  • B. SIGPIPE comes from writing to a closed pipe.
  • C. SIGCHLD tells a parent that a child changed state.
  • D. SIGALRM is raised by a timer.

Question 9Hard

What does kill -STOP PID followed by kill -CONT PID do?

  1. Terminates then restarts the process
  2. Pauses the process, then resumes it
  3. Reloads its configuration
  4. Sends it to the background permanently

Answer: B. Pauses the process, then resumes it

Explanation

SIGSTOP suspends execution and SIGCONT resumes it.

Step-by-step solution

  1. Kill -STOP PID sends SIGSTOP which pauses the process.
  2. SIGSTOP stops the process from running temporarily.
  3. Kill -CONT PID sends SIGCONT which resumes the paused process.
  4. SIGCONT allows the process to continue executing after being stopped.
  5. Pausing and resuming is the correct effect of these signals.

Why the other options are wrong

  • A. SIGSTOP pauses the process and SIGCONT resumes it; neither terminates the process.
  • C. Reloading config is done by SIGHUP for daemons; STOP and CONT pause and resume the process.
  • D. These signals do not move the process to the background; it stays paused, then resumes.

Tip: Use SIGSTOP and SIGCONT to pause and resume processes in Unix systems.

Question 10Hard

Where does Linux expose per-process details such as /proc/<pid>/status?

  1. /var/proc, a normal directory that is stored on the disk
  2. /etc/process
  3. /dev/ps
  4. /proc, a virtual filesystem generated by the kernel

Answer: D. /proc, a virtual filesystem generated by the kernel

Explanation

Files under /proc are not stored on disk; they are generated on read.

Step-by-step solution

  1. The kernel exposes its state.
  2. It mounts a pseudo filesystem.
  3. /proc/<pid> has one folder per process.

Why the other options are wrong

  • A. Not a real path.
  • B. Not a real path.
  • C. Devices are in /dev.

Practise all 20 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Linux & Shell topics · All topics