UNIX MCQs – Process Basics (Part – 3)

UNIX Question and Answer – UNIX Process Basics

UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test

1. 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 is used to create a new process by duplicating the existing one in UNIX.


2. 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.


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 is used to display detailed information about all processes in UNIX.


4. What is the role of the exec() system call in UNIX?

a) Create a new process

b) Replace the current process with a new program

c) Send a signal to a process

d) Suspend the execution of a process

Answer: b) Replace the current process with a new program

Explanation: The exec() system call is used to replace the current process with a new program in UNIX.


5. Which command is used to change the priority of a process in UNIX?

a) renice

b) nice

c) prio

d) priority

Answer: a) renice

Explanation: The renice command is used to change the priority of a process in UNIX.


6. What is the purpose 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 is used by a parent process to suspend its execution until a specific child process terminates.


7. What is the state of a process that is waiting for a specific event to occur, such as an I/O operation?

a) Running

b) Ready

c) Sleeping

d) Blocked

Answer: d) Blocked

Explanation: A process in the blocked state is waiting for a specific event, such as an I/O operation, to occur before it can proceed.


8. 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.


9. What is the purpose of the getpid() system call in UNIX?

a) Retrieve the process ID of the parent process

b) Retrieve the process ID of the current process

c) Retrieve the process ID of a specific process

d) Retrieve the process ID of the child process

Answer: b) Retrieve the process ID of the current process

Explanation: The getpid() system call is used to retrieve the process ID (PID) of the current process in UNIX.


10. Which command is used to display a hierarchical tree of processes in UNIX?

a) ps -t

b) pstree

c) top -t

d) tree

Answer: b) pstree

Explanation: The pstree command is used to display a hierarchical tree of processes in UNIX, showing their parent-child relationships.


11. 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 such as a file or input/output operation to become available before it can proceed.


12. 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 is used to suspend the execution of a process until it receives a signal.


13. What is the role of the parent process in UNIX?

a) Provide CPU resources to child processes

b) Terminate child processes

c) Communicate with child processes and manage their execution

d) Execute user commands

Answer: c) Communicate with child processes and manage their execution

Explanation: The parent process in UNIX communicates with its child processes, manages their execution, and receives their termination status.


14. 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.


15. What is the state of a process that has been terminated but its parent has not yet acknowledged its termination?

a) Running

b) Ready

c) Zombie

d) Stopped

Answer: c) Zombie

Explanation: A zombie process has been terminated but its parent has not yet acknowledged its termination.


16. 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.


17. What is the purpose of the getpid() system call in UNIX?

a) Retrieve the process ID of the parent process

b) Retrieve the process ID of the current process

c) Retrieve the process ID of a specific process

d) Retrieve the process ID of the child process

Answer: b) Retrieve the process ID of the current process

Explanation: The getpid() system call is used to retrieve the process ID (PID) of the current process in UNIX.


18. Which command is used to display a hierarchical tree of processes in UNIX?

a) ps -t

b) pstree

c) top -t

d) tree

Answer: b) pstree

Explanation: The pstree command is used to display a hierarchical tree of processes in UNIX, showing their parent-child relationships.


19. 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 such as a file or input/output operation to become available before it can proceed.


20. 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 is used to suspend the execution of a process until it receives a signal.


21. What is the role of the parent process in UNIX?

a) Provide CPU resources to child processes

b) Terminate child processes

c) Communicate with child processes and manage their execution

d) Execute user commands

Answer: c) Communicate with child processes and manage their execution

Explanation: The parent process in UNIX communicates with its child processes, manages their execution, and receives their termination status.


22. 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.


23. What is the state of a process that has been terminated but its parent has not yet acknowledged its termination?

a) Running

b) Ready

c) Zombie

d) Stopped

Answer: c) Zombie

Explanation: A zombie process has been terminated but its parent has not yet acknowledged its termination.


24. 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.


25. What is the purpose of the getpid() system call in UNIX?

a) Retrieve the process ID of the parent process

b) Retrieve the process ID of the current process

c) Retrieve the process ID of a specific process

d) Retrieve the process ID of the child process

Answer: b) Retrieve the process ID of the current process

Explanation: The getpid() system call is used to retrieve the process ID (PID) of the current process in UNIX.


26. What is the primary purpose 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 change the scheduling priority of a process in UNIX?

a) nice

b) renice

c) priority

d) prio

Answer: b) renice

Explanation: The renice command is used to change the scheduling priority of a process in UNIX.


29. 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.


30. 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.


31. 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.


32. 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 is used to suspend the execution of a process until it receives a signal.


33. 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.


34. 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.


35. 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.


36. What is the purpose of the exec() system call in UNIX?

a) Create a new process

b) Replace the current process with a new program

c) Send a signal to a process

d) Suspend the execution of a process

Answer: b) Replace the current process with a new program

Explanation: The exec() system call replaces the current process with a new program in UNIX.


37. Which command is used to change the priority of a process in UNIX?

a) renice

b) nice

c) prio

d) priority

Answer: a) renice

Explanation: The renice command changes the priority of a process in UNIX.


38. 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 suspends the calling process until a specific child process terminates.


39. What is the state of a process that is waiting for a specific event to occur, such as an I/O operation?

a) Running

b) Ready

c) Sleeping

d) Blocked

Answer: d) Blocked

Explanation: A process in the blocked state is waiting for a specific event, such as an I/O operation, to occur.


40. 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 displays real-time information about CPU and memory usage in UNIX.


41. What is the purpose of the getpid() system call in UNIX?

a) Retrieve the process ID of the parent process

b) Retrieve the process ID of the current process

c) Retrieve the process ID of a specific process

d) Retrieve the process ID of the child process

Answer: b) Retrieve the process ID of the current process

Explanation: The getpid() system call retrieves the process ID of the current process in UNIX.


42. Which command is used to display a hierarchical tree of processes in UNIX?

a) ps -t

b) pstree

c) top -t

d) tree

Answer: b) pstree

Explanation: The pstree command displays a hierarchical tree of processes in UNIX.


43. 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.


44. 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.


45. What is the role of the parent process in UNIX?

a) Provide CPU resources to child processes

b) Terminate child processes

c) Communicate with child processes and manage their execution

d) Execute user commands

Answer: c) Communicate with child processes and manage their execution

Explanation: The parent process in UNIX communicates with its child processes, manages their execution, and receives their termination status.


46. 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 displays real-time information about CPU and memory usage in UNIX.


47. What is the state of a process that has been terminated but its parent has not yet acknowledged its termination?

a) Running

b) Ready

c) Zombie

d) Stopped

Answer: c) Zombie

Explanation: A zombie process has been terminated but its parent has not yet acknowledged its termination.


48. 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.


49. What is the purpose of the getpid() system call in UNIX?

a) Retrieve the process ID of the parent process

b) Retrieve the process ID of the current process

c) Retrieve the process ID of a specific process

d) Retrieve the process ID of the child process

Answer: b) Retrieve the process ID of the current process

Explanation: The getpid() system call retrieves the process ID of the current process in UNIX.


50. Which command is used to display a hierarchical tree of processes in UNIX?

a) ps -t

b) pstree

c) top -t

d) tree

Answer: b) pstree

Explanation: The pstree command displays a hierarchical tree of processes in UNIX.

Related Articles

Linux MCQ

Welcome to Linux Multiple Choice Questions (MCQ) Section Embark on a journey through the world of...