Sample questions
Question 1Easy
Which key combination in a terminal normally sends SIGINT to the foreground job?
- Ctrl+Z
- Ctrl+D
- Ctrl+C
- 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
- The terminal driver maps keys to signals.
- Ctrl+C = SIGINT.
- 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?
- jobs
- top -k
- pstree -c
- 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
- Use
ps for a snapshot. aux means all users, with user-oriented format.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?
- pgrep nginx
- pidof -all nginx*
- ps nginx
- lookup nginx
Answer: A. pgrep nginx
Explanation
pgrep pattern prints matching PIDs. pkill sends them a signal.
Step-by-step solution
- Use
pgrep. - It matches process names.
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?
- SIGKILL (9)
- SIGINT (2)
- SIGSTOP (19)
- 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
- No signal named means the default.
- The default is SIGTERM.
- 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?
- Run every 30 minutes at 2 AM only
- Run on the 2nd day at 30 hours
- Run every day at 02:30
- 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
- Minute field is 30 meaning task runs at 30th minute.
- Hour field is 2 meaning task runs at 2 AM.
- Day of month, month, and day of week are wildcards so it runs every day.
- So the entry runs every day at 02:30.
- 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?
- cron runs a job once; at repeats it forever
- at needs root privileges; cron does not
- cron runs jobs on a repeating schedule; at runs a job once at a given time
- 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
- Cron runs jobs on a repeating schedule.
- At runs a job once at a given time.
- Cron uses a crontab for scheduling.
- At is used for one-time tasks.
- The difference is in repetition vs single execution.
- 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?
- The exit status of the last command that finished in the script
- The PID of the most recent background command
- The PID of the script
- 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
- Start
cmd &. $! stores its PID.- 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)?
- SIGSEGV
- SIGPIPE
- SIGCHLD
- 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
- The process reads or writes an address it does not own.
- The MMU faults and the kernel sends SIGSEGV.
- 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?
- Terminates then restarts the process
- Pauses the process, then resumes it
- Reloads its configuration
- 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
- Kill -STOP PID sends SIGSTOP which pauses the process.
- SIGSTOP stops the process from running temporarily.
- Kill -CONT PID sends SIGCONT which resumes the paused process.
- SIGCONT allows the process to continue executing after being stopped.
- 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?
- /var/proc, a normal directory that is stored on the disk
- /etc/process
- /dev/ps
- /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
- The kernel exposes its state.
- It mounts a pseudo filesystem.
/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 →