UNIX Question and Answer – Background and Foreground Processes
UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test
1. Which command is used to send a signal to a process by its process ID (PID) in UNIX?
a) kill
b) pkill
c) signal
d) psignal
Answer: a) kill
Explanation: The kill command is used to send a signal to a process by its process ID (PID) in UNIX.
2. In UNIX, what happens to a background process when the shell session is suspended using Ctrl+Z?
a) It continues running in the background
b) It is paused and moved to the foreground
c) It is terminated
d) It is resumed automatically
Answer: b) It is paused and moved to the foreground
Explanation: When the shell session is suspended using Ctrl+Z, the background process is paused and moved to the foreground in UNIX.
3. What is the purpose of the kill command with the -9 option in UNIX?
a) Pause a process
b) Terminate a process immediately
c) Send a stop signal to a process
d) Change the priority of a process
Answer: b) Terminate a process immediately
Explanation: The kill command with the -9 option is used to terminate a process immediately in UNIX.
4. In UNIX, what does the term “foreground” refer to in the context of processes?
a) Processes that are running in the background
b) Processes that are running in the terminal and are interactive
c) Processes that are paused
d) Processes that are running with elevated privileges
Answer: b) Processes that are running in the terminal and are interactive
Explanation: In UNIX, foreground processes refer to processes that are running in the terminal and are interactive.
5. Which command is used to send a signal to a process by its name in UNIX?
a) signal
b) killall
c) pkill
d) psignal
Answer: c) pkill
Explanation: The pkill command is used to send a signal to a process by its name in UNIX.
6. In UNIX, what is the purpose of the renice command?
a) Change the name of a process
b) Change the priority of a process
c) Change the owner of a process
d) Change the group of a process
Answer: b) Change the priority of a process
Explanation: The renice command is used to change the priority of a process in UNIX.
7. What signal is sent to a process when the Ctrl+C key combination is pressed in UNIX?
a) SIGKILL
b) SIGTERM
c) SIGHUP
d) SIGINT
Answer: d) SIGINT
Explanation: SIGINT is sent to a process when the Ctrl+C key combination is pressed in UNIX.
8. What is the purpose of the nohup command in UNIX?
a) Run a command in the background and ignore hangup signals
b) Run a command with elevated privileges
c) Run a command in the foreground
d) Run a command without any output
Answer: a) Run a command in the background and ignore hangup signals
Explanation: The nohup command is used to run a command in the background and ignore hangup signals in UNIX.
9. In UNIX, what does the term “foreground” refer to in the context of processes?
a) Processes that are running in the background
b) Processes that are running in the terminal and are interactive
c) Processes that are paused
d) Processes that are running with elevated privileges
Answer: b) Processes that are running in the terminal and are interactive
Explanation: In UNIX, foreground processes refer to processes that are running in the terminal and are interactive.
10. Which command is used to display the process ID (PID) of a running process in UNIX?
a) pid
b) pidof
c) psid
d) getpid
Answer: b) pidof
Explanation: The pidof command is used to display the process ID (PID) of a running process in UNIX.
11. In UNIX, what happens to a background process when the shell session is suspended using Ctrl+Z?
a) It continues running in the background
b) It is paused and moved to the foreground
c) It is terminated
d) It is resumed automatically
Answer: b) It is paused and moved to the foreground
Explanation: When the shell session is suspended using Ctrl+Z, the background process is paused and moved to the foreground in UNIX.
12. What is the purpose of the kill command with the -9 option in UNIX?
a) Pause a process
b) Terminate a process immediately
c) Send a stop signal to a process
d) Change the priority of a process
Answer: b) Terminate a process immediately
Explanation: The kill command with the -9 option is used to terminate a process immediately in UNIX.
13. In UNIX, what does the term “foreground” refer to in the context of processes?
a) Processes that are running in the background
b) Processes that are running in the terminal and are interactive
c) Processes that are paused
d) Processes that are running with elevated privileges
Answer: b) Processes that are running in the terminal and are interactive
Explanation: In UNIX, foreground processes refer to processes that are running in the terminal and are interactive.
14. Which command is used to send a signal to a process by its name in UNIX?
a) signal
b) killall
c) pkill
d) psignal
Answer: c) pkill
Explanation: The pkill command is used to send a signal to a process by its name in UNIX.
15. In UNIX, what is the purpose of the renice command?
a) Change the name of a process
b) Change the priority of a process
c) Change the owner of a process
d) Change the group of a process
Answer: b) Change the priority of a process
Explanation: The renice command is used to change the priority of a process in UNIX.
16. What signal is sent to a process when the Ctrl+C key combination is pressed in UNIX?
a) SIGKILL
b) SIGTERM
c) SIGHUP
d) SIGINT
Answer: d) SIGINT
Explanation: SIGINT is sent to a process when the Ctrl+C key combination is pressed in UNIX.
17. What is the purpose of the nohup command in UNIX?
a) Run a command in the background and ignore hangup signals
b) Run a command with elevated privileges
c) Run a command in the foreground
d) Run a command without any output
Answer: a) Run a command in the background and ignore hangup signals
Explanation: The nohup command is used to run a command in the background and ignore hangup signals in UNIX.
18. In UNIX, what does the term “foreground” refer to in the context of processes?
a) Processes that are running in the background
b) Processes that are running in the terminal and are interactive
c) Processes that are paused
d) Processes that are running with elevated privileges
Answer: b) Processes that are running in the terminal and are interactive
Explanation: In UNIX, foreground processes refer to processes that are running in the terminal and are interactive.
19. Which command is used to display the process ID (PID) of a running process in UNIX?
a) pid
b) pidof
c) psid
d) getpid
Answer: b) pidof
Explanation: The pidof command is used to display the process ID (PID) of a running process in UNIX.
20. In UNIX, what happens to a background process when the shell session is suspended using Ctrl+Z?
a) It continues running in the background
b) It is paused and moved to the foreground
c) It is terminated
d) It is resumed automatically
Answer: b) It is paused and moved to the foreground
Explanation: When the shell session is suspended using Ctrl+Z, the background process is paused and moved to the foreground in UNIX.
21. What is the purpose of the kill command with the -9 option in UNIX?
a) Pause a process
b) Terminate a process immediately
c) Send a stop signal to a process
d) Change the priority of a process
Answer: b) Terminate a process immediately
Explanation: The kill command with the -9 option is used to terminate a process immediately in UNIX.
22. In UNIX, what does the term “foreground” refer to in the context of processes?
a) Processes that are running in the background
b) Processes that are running in the terminal and are interactive
c) Processes that are paused
d) Processes that are running with elevated privileges
Answer: b) Processes that are running in the terminal and are interactive
Explanation: In UNIX, foreground processes refer to processes that are running in the terminal and are interactive.
23. Which command is used to send a signal to a process by its name in UNIX?
a) signal
b) killall
c) pkill
d) psignal
Answer: c) pkill
Explanation: The pkill command is used to send a signal to a process by its name in UNIX.
24. In UNIX, what is the purpose of the renice command?
a) Change the name of a process
b) Change the priority of a process
c) Change the owner of a process
d) Change the group of a process
Answer: b) Change the priority of a process
Explanation: The renice command is used to change the priority of a process in UNIX.
25. What signal is sent to a process when the Ctrl+C key combination is pressed in UNIX?
a) SIGKILL
b) SIGTERM
c) SIGHUP
d) SIGINT
Answer: d) SIGINT
Explanation: SIGINT is sent to a process when the Ctrl+C key combination is pressed in UNIX.
26. Which command is used to send a signal to a process by its process ID (PID) in UNIX?
a) kill
b) pkill
c) signal
d) psignal
Answer: a) kill
Explanation: The kill command is used to send a signal to a process by its process ID (PID) in UNIX.
27. In UNIX, what happens to a background process when the shell session is suspended using Ctrl+Z?
a) It continues running in the background
b) It is paused and moved to the foreground
c) It is terminated
d) It is resumed automatically
Answer: b) It is paused and moved to the foreground
Explanation: When the shell session is suspended using Ctrl+Z, the background process is paused and moved to the foreground in UNIX.
28. What is the purpose of the kill command with the -9 option in UNIX?
a) Pause a process
b) Terminate a process immediately
c) Send a stop signal to a process
d) Change the priority of a process
Answer: b) Terminate a process immediately
Explanation: The kill command with the -9 option is used to terminate a process immediately in UNIX.
29. In UNIX, what does the term “foreground” refer to in the context of processes?
a) Processes that are running in the background
b) Processes that are running in the terminal and are interactive
c) Processes that are paused
d) Processes that are running with elevated privileges
Answer: b) Processes that are running in the terminal and are interactive
Explanation: In UNIX, foreground processes refer to processes that are running in the terminal and are interactive.
30. Which command is used to send a signal to a process by its name in UNIX?
a) signal
b) killall
c) pkill
d) psignal
Answer: c) pkill
Explanation: The pkill command is used to send a signal to a process by its name in UNIX.
31. In UNIX, what is the purpose of the renice command?
a) Change the name of a process
b) Change the priority of a process
c) Change the owner of a process
d) Change the group of a process
Answer: b) Change the priority of a process
Explanation: The renice command is used to change the priority of a process in UNIX.
32. What signal is sent to a process when the Ctrl+C key combination is pressed in UNIX?
a) SIGKILL
b) SIGTERM
c) SIGHUP
d) SIGINT
Answer: d) SIGINT
Explanation: SIGINT is sent to a process when the Ctrl+C key combination is pressed in UNIX.
33. What is the purpose of the nohup command in UNIX?
a) Run a command in the background and ignore hangup signals
b) Run a command with elevated privileges
c) Run a command in the foreground
d) Run a command without any output
Answer: a) Run a command in the background and ignore hangup signals
Explanation: The nohup command is used to run a command in the background and ignore hangup signals in UNIX.
34. In UNIX, what does the term “foreground” refer to in the context of processes?
a) Processes that are running in the background
b) Processes that are running in the terminal and are interactive
c) Processes that are paused
d) Processes that are running with elevated privileges
Answer: b) Processes that are running in the terminal and are interactive
Explanation: In UNIX, foreground processes refer to processes that are running in the terminal and are interactive.
35. Which command is used to display the process ID (PID) of a running process in UNIX?
a) pid
b) pidof
c) psid
d) getpid
Answer: b) pidof
Explanation: The pidof command is used to display the process ID (PID) of a running process in UNIX.
36. In UNIX, what happens to a background process when the shell session is suspended using Ctrl+Z?
a) It continues running in the background
b) It is paused and moved to the foreground
c) It is terminated
d) It is resumed automatically
Answer: b) It is paused and moved to the foreground
Explanation: When the shell session is suspended using Ctrl+Z, the background process is paused and moved to the foreground in UNIX.
37. What is the purpose of the kill command with the -9 option in UNIX?
a) Pause a process
b) Terminate a process immediately
c) Send a stop signal to a process
d) Change the priority of a process
Answer: b) Terminate a process immediately
Explanation: The kill command with the -9 option is used to terminate a process immediately in UNIX.
38. In UNIX, what does the term “foreground” refer to in the context of processes?
a) Processes that are running in the background
b) Processes that are running in the terminal and are interactive
c) Processes that are paused
d) Processes that are running with elevated privileges
Answer: b) Processes that are running in the terminal and are interactive
Explanation: In UNIX, foreground processes refer to processes that are running in the terminal and are interactive.
39. Which command is used to send a signal to a process by its name in UNIX?
a) signal
b) killall
c) pkill
d) psignal
Answer: c) pkill
Explanation: The pkill command is used to send a signal to a process by its name in UNIX.
40. In UNIX, what is the purpose of the renice command?
a) Change the name of a process
b) Change the priority of a process
c) Change the owner of a process
d) Change the group of a process
Answer: b) Change the priority of a process
Explanation: The renice command is used to change the priority of a process in UNIX.
41. What signal is sent to a process when the Ctrl+C key combination is pressed in UNIX?
a) SIGKILL
b) SIGTERM
c) SIGHUP
d) SIGINT
Answer: d) SIGINT
Explanation: SIGINT is sent to a process when the Ctrl+C key combination is pressed in UNIX.
42. What is the purpose of the nohup command in UNIX?
a) Run a command in the background and ignore hangup signals
b) Run a command with elevated privileges
c) Run a command in the foreground
d) Run a command without any output
Answer: a) Run a command in the background and ignore hangup signals
Explanation: The nohup command is used to run a command in the background and ignore hangup signals in UNIX.
43. In UNIX, what does the term “foreground” refer to in the context of processes?
a) Processes that are running in the background
b) Processes that are running in the terminal and are interactive
c) Processes that are paused
d) Processes that are running with elevated privileges
Answer: b) Processes that are running in the terminal and are interactive
Explanation: In UNIX, foreground processes refer to processes that are running in the terminal and are interactive.
44. Which command is used to display the process ID (PID) of a running process in UNIX?
a) pid
b) pidof
c) psid
d) getpid
Answer: b) pidof
Explanation: The pidof command is used to display the process ID (PID) of a running process in UNIX.
45. In UNIX, what happens to a background process when the shell session is suspended using Ctrl+Z?
a) It continues running in the background
b) It is paused and moved to the foreground
c) It is terminated
d) It is resumed automatically
Answer: b) It is paused and moved to the foreground
Explanation: When the shell session is suspended using Ctrl+Z, the background process is paused and moved to the foreground in UNIX.