UNIX Question and Answer – UNIX Process Basics
UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test
1. What is the role of the execvp() system call in UNIX?
a) Create a new process
b) Replace the current process with a new program
c) Suspend the execution of a process
d) Retrieve the process ID of the current process
Answer: b) Replace the current process with a new program
Explanation: The execvp() system call is used to replace the current process image with a new program.
2. What happens when a process receives a SIGTERM signal in UNIX?
a) The process is suspended
b) The process is terminated immediately
c) The process is put to sleep
d) The process resumes execution
Answer: b) The process is terminated immediately
Explanation: SIGTERM is a signal sent to request termination of a process in UNIX.
3. Which command is used to display detailed information about all processes in UNIX?
a) ps -l
b) top -a
c) pstree
d) procinfo
Answer: a) ps -l
Explanation: The ps -l command displays detailed information about all processes in UNIX.
4. What is the role of the waitpid() system call in UNIX?
a) Suspend the calling process until a child process terminates
b) Terminate the calling process
c) Execute a new process
d) Send a signal to another process
Answer: a) Suspend the calling process until a child process terminates
Explanation: The waitpid() system call in UNIX suspends the execution of the calling process until one of its child processes terminates.
5. Which command is used to change the scheduling priority of a process in UNIX?
a) renice
b) nice
c) priority
d) prio
Answer: a) renice
Explanation: The renice command changes the scheduling priority of a process in UNIX.
6. What is the primary function of the fork() system call in UNIX?
a) Terminate the current process
b) Create a new process by duplicating the existing one
c) Send a signal to a process
d) Change the priority of a process
Answer: b) Create a new process by duplicating the existing one
Explanation: The fork() system call creates a new process by duplicating the existing one in UNIX.
7. What is the state of a process that is ready to execute but is waiting for CPU time?
a) Running
b) Ready
c) Sleeping
d) Stopped
Answer: b) Ready
Explanation: A process in the ready state is prepared to execute but is waiting for CPU time.
8. What is the role of the init process in UNIX?
a) Terminate child processes
b) Manage system initialization and process management
c) Communicate with child processes and manage their execution
d) Provide CPU resources to child processes
Answer: b) Manage system initialization and process management
Explanation: The init process in UNIX is responsible for system initialization and managing the process lifecycle.
9. Which command is used to send a specific signal to a process in UNIX?
a) kill -SIGNAL
b) signal
c) sigsend
d) send
Answer: a) kill -SIGNAL
Explanation: The kill command with the -SIGNAL option is used to send a specific signal to a process in UNIX.
10. What is the state of a process that is waiting for a resource such as a file or input/output operation to become available?
a) Ready
b) Running
c) Sleeping
d) Blocked
Answer: d) Blocked
Explanation: A process in the blocked state is waiting for a resource to become available before it can proceed.
11. Which system call is used to suspend the execution of a process until it receives a signal?
a) stop()
b) suspend()
c) pause()
d) sleep()
Answer: c) pause()
Explanation: The pause() system call suspends the execution of a process until it receives a signal.
12. What is the primary function of the fork() system call in UNIX?
a) Terminate the current process
b) Create a new process by duplicating the existing one
c) Send a signal to a process
d) Change the priority of a process
Answer: b) Create a new process by duplicating the existing one
Explanation: The fork() system call creates a new process by duplicating the existing one in UNIX.
13. What is the state of a process that is ready to execute but is waiting for CPU time?
a) Running
b) Ready
c) Sleeping
d) Stopped
Answer: b) Ready
Explanation: A process in the ready state is prepared to execute but is waiting for CPU time.
14. What is the role of the init process in UNIX?
a) Terminate child processes
b) Manage system initialization and process management
c) Communicate with child processes and manage their execution
d) Provide CPU resources to child processes
Answer: b) Manage system initialization and process management
Explanation: The init process in UNIX is responsible for system initialization and managing the process lifecycle.
15. Which command is used to send a specific signal to a process in UNIX?
a) kill -SIGNAL
b) signal
c) sigsend
d) send
Answer: a) kill -SIGNAL
Explanation: The kill command with the -SIGNAL option is used to send a specific signal to a process in UNIX.
16. What is the state of a process that is waiting for a resource such as a file or input/output operation to become available?
a) Ready
b) Running
c) Sleeping
d) Blocked
Answer: d) Blocked
Explanation: A process in the blocked state is waiting for a resource to become available before it can proceed.
17. Which system call is used to suspend the execution of a process until it receives a signal?
a) stop()
b) suspend()
c) pause()
d) sleep()
Answer: c) pause()
Explanation: The pause() system call suspends the execution of a process until it receives a signal.
18. What is the role of the execvp() system call in UNIX?
a) Create a new process
b) Replace the current process with a new program
c) Suspend the execution of a process
d) Retrieve the process ID of the current process
Answer: b) Replace the current process with a new program
Explanation: The execvp() system call is used to replace the current process image with a new program.
19. What happens when a process receives a SIGTERM signal in UNIX?
a) The process is suspended
b) The process is terminated immediately
c) The process is put to sleep
d) The process resumes execution
Answer: b) The process is terminated immediately
Explanation: SIGTERM is a signal sent to request termination of a process in UNIX.
20. Which command is used to display detailed information about all processes in UNIX?
a) ps -l
b) top -a
c) pstree
d) procinfo
Answer: a) ps -l
Explanation: The ps -l command displays detailed information about all processes in UNIX.
21. What is the role of the waitpid() system call in UNIX?
a) Suspend the calling process until a child process terminates
b) Terminate the calling process
c) Execute a new process
d) Send a signal to another process
Answer: a) Suspend the calling process until a child process terminates
Explanation: The waitpid() system call in UNIX suspends the execution of the calling process until one of its child processes terminates.
22. Which command is used to change the scheduling priority of a process in UNIX?
a) renice
b) nice
c) priority
d) prio
Answer: a) renice
Explanation: The renice command changes the scheduling priority of a process in UNIX.
23. What is the primary function of the fork() system call in UNIX?
a) Terminate the current process
b) Create a new process by duplicating the existing one
c) Send a signal to a process
d) Change the priority of a process
Answer: b) Create a new process by duplicating the existing one
Explanation: The fork() system call creates a new process by duplicating the existing one in UNIX.
24. What is the state of a process that is ready to execute but is waiting for CPU time?
a) Running
b) Ready
c) Sleeping
d) Stopped
Answer: b) Ready
Explanation: A process in the ready state is prepared to execute but is waiting for CPU time.
25. What is the role of the init process in UNIX?
a) Terminate child processes
b) Manage system initialization and process management
c) Communicate with child processes and manage their execution
d) Provide CPU resources to child processes
Answer: b) Manage system initialization and process management
Explanation: The init process in UNIX is responsible for system initialization and managing the process lifecycle.
26. What is the primary function of the wait() system call in UNIX?
a) Suspend the calling process until a child process terminates
b) Terminate the calling process
c) Execute a new process
d) Send a signal to another process
Answer: a) Suspend the calling process until a child process terminates
Explanation: The wait() system call in UNIX suspends the execution of the calling process until one of its child processes terminates.
27. What happens when a process receives a SIGKILL signal in UNIX?
a) The process is suspended
b) The process is terminated immediately
c) The process is put to sleep
d) The process resumes execution
Answer: b) The process is terminated immediately
Explanation: SIGKILL is a signal that terminates a process immediately in UNIX.
28. Which command is used to display real-time information about CPU and memory usage in UNIX?
a) meminfo
b) top
c) sysinfo
d) ps
Answer: b) top
Explanation: The top command is used to display real-time information about CPU and memory usage in UNIX.
29. What is the role of the waitpid() system call in UNIX?
a) Suspend the calling process until a child process terminates
b) Terminate the calling process
c) Execute a new process
d) Send a signal to another process
Answer: a) Suspend the calling process until a child process terminates
Explanation: The waitpid() system call in UNIX suspends the execution of the calling process until one of its child processes terminates.
30. Which command is used to change the scheduling priority of a process in UNIX?
a) renice
b) nice
c) priority
d) prio
Answer: a) renice
Explanation: The renice command changes the scheduling priority of a process in UNIX.
31. What is the primary function of the fork() system call in UNIX?
a) Terminate the current process
b) Create a new process by duplicating the existing one
c) Send a signal to a process
d) Change the priority of a process
Answer: b) Create a new process by duplicating the existing one
Explanation: The fork() system call creates a new process by duplicating the existing one in UNIX.
32. What is the state of a process that is ready to execute but is waiting for CPU time?
a) Running
b) Ready
c) Sleeping
d) Stopped
Answer: b) Ready
Explanation: A process in the ready state is prepared to execute but is waiting for CPU time.
33. What is the role of the init process in UNIX?
a) Terminate child processes
b) Manage system initialization and process management
c) Communicate with child processes and manage their execution
d) Provide CPU resources to child processes
Answer: b) Manage system initialization and process management
Explanation: The init process in UNIX is responsible for system initialization and managing the process lifecycle.
34. Which command is used to send a specific signal to a process in UNIX?
a) kill -SIGNAL
b) signal
c) sigsend
d) send
Answer: a) kill -SIGNAL
Explanation: The kill command with the -SIGNAL option is used to send a specific signal to a process in UNIX.
35. What is the state of a process that is waiting for a resource such as a file or input/output operation to become available?
a) Ready
b) Running
c) Sleeping
d) Blocked
Answer: d) Blocked
Explanation: A process in the blocked state is waiting for a resource to become available before it can proceed.
36. Which system call is used to suspend the execution of a process until it receives a signal?
a) stop()
b) suspend()
c) pause()
d) sleep()
Answer: c) pause()
Explanation: The pause() system call suspends the execution of a process until it receives a signal.
37. What is the primary function of the fork() system call in UNIX?
a) Terminate the current process
b) Create a new process by duplicating the existing one
c) Send a signal to a process
d) Change the priority of a process
Answer: b) Create a new process by duplicating the existing one
Explanation: The fork() system call creates a new process by duplicating the existing one in UNIX.
38. What is the state of a process that is ready to execute but is waiting for CPU time?
a) Running
b) Ready
c) Sleeping
d) Stopped
Answer: b) Ready
Explanation: A process in the ready state is prepared to execute but is waiting for CPU time.
39. What is the role of the init process in UNIX?
a) Terminate child processes
b) Manage system initialization and process management
c) Communicate with child processes and manage their execution
d) Provide CPU resources to child processes
Answer: b) Manage system initialization and process management
Explanation: The init process in UNIX is responsible for system initialization and managing the process lifecycle.
40. Which command is used to send a specific signal to a process in UNIX?
a) kill -SIGNAL
b) signal
c) sigsend
d) send
Answer: a) kill -SIGNAL
Explanation: The kill command with the -SIGNAL option is used to send a specific signal to a process in UNIX.
41. What is the state of a process that is waiting for a resource such as a file or input/output operation to become available?
a) Ready
b) Running
c) Sleeping
d) Blocked
Answer: d) Blocked
Explanation: A process in the blocked state is waiting for a resource to become available before it can proceed.
42. Which system call is used to suspend the execution of a process until it receives a signal?
a) stop()
b) suspend()
c) pause()
d) sleep()
Answer: c) pause()
Explanation: The pause() system call suspends the execution of a process until it receives a signal.
43. What is the role of the execvp() system call in UNIX?
a) Create a new process
b) Replace the current process with a new program
c) Suspend the execution of a process
d) Retrieve the process ID of the current process
Answer: b) Replace the current process with a new program
Explanation: The execvp() system call is used to replace the current process image with a new program.
44. What happens when a process receives a SIGTERM signal in UNIX?
a) The process is suspended
b) The process is terminated immediately
c) The process is put to sleep
d) The process resumes execution
Answer: b) The process is terminated immediately
Explanation: SIGTERM is a signal sent to request termination of a process in UNIX.
45. Which command is used to display detailed information about all processes in UNIX?
a) ps -l
b) top -a
c) pstree
d) procinfo
Answer: a) ps -l
Explanation: The ps -l command displays detailed information about all processes in UNIX.
46. What is the role of the waitpid() system call in UNIX?
a) Suspend the calling process until a child process terminates
b) Terminate the calling process
c) Execute a new process
d) Send a signal to another process
Answer: a) Suspend the calling process until a child process terminates
Explanation: The waitpid() system call in UNIX suspends the execution of the calling process until one of its child processes terminates.
47. Which command is used to change the scheduling priority of a process in UNIX?
a) renice
b) nice
c) priority
d) prio
Answer: a) renice
Explanation: The renice command changes the scheduling priority of a process in UNIX.
48. What is the primary function of the fork() system call in UNIX?
a) Terminate the current process
b) Create a new process by duplicating the existing one
c) Send a signal to a process
d) Change the priority of a process
Answer: b) Create a new process by duplicating the existing one
Explanation: The fork() system call creates a new process by duplicating the existing one in UNIX.
49. What is the state of a process that is ready to execute but is waiting for CPU time?
a) Running
b) Ready
c) Sleeping
d) Stopped
Answer: b) Ready
Explanation: A process in the ready state is prepared to execute but is waiting for CPU time.
50. What is the role of the init process in UNIX?
a) Terminate child processes
b) Manage system initialization and process management
c) Communicate with child processes and manage their execution
d) Provide CPU resources to child processes
Answer: b) Manage system initialization and process management
Explanation: The init process in UNIX is responsible for system initialization and managing the process lifecycle.