UNIX Question and Answer – UNIX’s Process Monitoring
UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test
1. Which command is used to display information about threads in a process in UNIX?
a) threads
b) pthreads
c) ps -T
d) top -t
Answer: c) ps -T
Explanation: The ps command with the -T option is used to display information about threads in a process in UNIX.
2. What signal is used to send a “hangup” signal to a process in UNIX?
a) SIGHUP
b) SIGINT
c) SIGTERM
d) SIGKILL
Answer: a) SIGHUP
Explanation: The SIGHUP signal is used to send a “hangup” signal to a process in UNIX.
3. Which command is used to display the status of processes in real-time in UNIX?
a) status
b) top
c) ps -r
d) pstree
Answer: b) top
Explanation: The top command is used to display the status of processes in real-time in UNIX.
4. What is the primary role of the pgrep command in UNIX?
a) Display process groups
b) Find processes based on their attributes
c) Display process priority
d) Display process tree
Answer: b) Find processes based on their attributes
Explanation: The pgrep command is primarily used to find processes based on their attributes in UNIX.
5. Which command is used to send a signal to all processes except for those in the same process group as the sender in UNIX?
a) kill
b) pkill -g
c) killall -g
d) kill -g
Answer: c) killall -g
Explanation: The killall command with the -g option is used to send a signal to all processes except for those in the same process group as the sender in UNIX.
6. What is the purpose of the nice value in UNIX process scheduling?
a) Adjust process priority
b) Set process affinity
c) Allocate memory
d) Define process name
Answer: a) Adjust process priority
Explanation: The nice value is used to adjust the priority of processes in UNIX process scheduling.
7. Which command is used to display information about kernel threads in UNIX?
a) kthreads
b) ps -k
c) top -k
d) kernelthreads
Answer: b) ps -k
Explanation: The ps command with the -k option is used to display information about kernel threads in UNIX.
8. What signal is used to terminate a process and its children in UNIX?
a) SIGTERM
b) SIGKILL
c) SIGSTOP
d) SIGINT
Answer: b) SIGKILL
Explanation: The SIGKILL signal is used to terminate a process and its children in UNIX.
9. Which command is used to display the status of all processes in UNIX?
a) allps
b) procstatus
c) ps -e
d) pstatus
Answer: c) ps -e
Explanation: The ps command with the -e option is used to display the status of all processes in UNIX.
10. What is the purpose of the niceness value in UNIX process management?
a) Allocate CPU time
b) Define process name
c) Set process affinity
d) Adjust process priority
Answer: d) Adjust process priority
Explanation: The niceness value is used to adjust the priority of processes in UNIX process management.
11. Which command is used to send a signal to a process group in UNIX?
a) kill -g
b) pkill -g
c) killall -g
d) pgkill
Answer: a) kill -g
Explanation: The kill command with the -g option is used to send a signal to a process group in UNIX.
12. What signal is used to interrupt a process and force it to stop executing in UNIX?
a) SIGSTOP
b) SIGTSTP
c) SIGINT
d) SIGTERM
Answer: c) SIGINT
Explanation: The SIGINT signal is used to interrupt a process and force it to stop executing in UNIX.
13. Which command is used to display information about system processes and their resource usage in UNIX, including threads?
a) ps -T
b) ps -L
c) ps -m
d) ps -G
Answer: b) ps -L
Explanation: The ps command with the -L option is used to display information about system processes and their resource usage in UNIX, including threads.
14. What is the purpose of the pmap command in UNIX?
a) Display memory map of a process
b) Display processor map
c) Display process map
d) Display priority map
Answer: a) Display memory map of a process
Explanation: The pmap command is used to display the memory map of a process in UNIX.
15. Which signal is used to suspend a process temporarily and allow it to be resumed later in UNIX?
a) SIGSTOP
b) SIGTSTP
c) SIGCONT
d) SIGINT
Answer: b) SIGTSTP
Explanation: The SIGTSTP signal is used to suspend a process temporarily and allow it to be resumed later in UNIX.
16. Which command is used to display information about the environment variables of a process in UNIX?
a) env
b) penv
c) ps -e
d) procenv
Answer: a) env
Explanation: The env command is used to display information about the environment variables of a process in UNIX.
17. What signal is used to terminate a process gracefully and allow it to perform cleanup tasks in UNIX?
a) SIGTERM
b) SIGINT
c) SIGHUP
d) SIGKILL
Answer: a) SIGTERM
Explanation: The SIGTERM signal is used to terminate a process gracefully and allow it to perform cleanup tasks in UNIX.
18. Which command is used to display the scheduling priority of a process in UNIX?
a) pri
b) priority
c) nice
d) niceness
Answer: c) nice
Explanation: The nice command is used to display the scheduling priority of a process in UNIX.
19. What is the purpose of the pidof command in UNIX?
a) Display process ID
b) Display parent process ID
c) Find the PID of a running program
d) Find the PID of a terminated program
Answer: c) Find the PID of a running program
Explanation: The pidof command is used to find the PID of a running program in UNIX.
20. Which signal is used to continue the execution of a stopped process in UNIX?
a) SIGCONT
b) SIGSTOP
c) SIGTSTP
d) SIGINT
Answer: a) SIGCONT
Explanation: The SIGCONT signal is used to continue the execution of a stopped process in UNIX.
21. Which command is used to display information about memory usage by processes in UNIX?
a) memstat
b) meminfo
c) pmap
d) top
Answer: c) pmap
Explanation: The pmap command is used to display information about memory usage by processes in UNIX.
22. What is the purpose of the time command in UNIX?
a) Display system time
b) Measure command execution time
c) Set system time
d) Display process time
Answer: b) Measure command execution time
Explanation: The time command is used to measure the execution time of commands in UNIX.
23. Which signal is used to suspend a process temporarily without stopping it in UNIX?
a) SIGTSTP
b) SIGSTOP
c) SIGCONT
d) SIGINT
Answer: a) SIGTSTP
Explanation: The SIGTSTP signal is used to suspend a process temporarily without stopping it in UNIX.
24. Which command is used to display information about system processes and their resource usage in UNIX?
a) psinfo
b) pinfo
c) pstree
d) ps
Answer: d) ps
Explanation: The ps command is used to display information about system processes and their resource usage in UNIX.
25. What is the purpose of the renice command in UNIX?
a) Change process owner
b) Change process group
c) Change process priority
d) Change process name
Answer: c) Change process priority
Explanation: The renice command is used to change the priority of a running process in UNIX.
26. Which command is used to display information about system processes and their resource usage in a user-friendly format in UNIX?
a) ps -u
b) ps -f
c) ps -l
d) ps -h
Answer: b) ps -f
Explanation: The ps command with the -f option is used to display information about system processes and their resource usage in a user-friendly format in UNIX.
27. What signal is used to terminate a process and its children gracefully in UNIX?
a) SIGKILL
b) SIGTERM
c) SIGINT
d) SIGHUP
Answer: b) SIGTERM
Explanation: The SIGTERM signal is used to terminate a process and its children gracefully in UNIX.
28. Which command is used to display information about system processes and their resource usage sorted by CPU usage in UNIX?
a) ps -c
b) ps -s
c) ps -o
d) ps -%CPU
Answer: d) ps -%CPU
Explanation: The ps command with the -%CPU option is used to display information about system processes and their resource usage sorted by CPU usage in UNIX.
29. What is the purpose of the killall command in UNIX?
a) Terminate processes by name
b) Terminate processes by PID
c) Terminate all processes
d) Terminate background processes
Answer: a) Terminate processes by name
Explanation: The killall command is used to terminate processes by name in UNIX.
30. Which signal is used to terminate a process and its children immediately in UNIX?
a) SIGTERM
b) SIGKILL
c) SIGINT
d) SIGHUP
Answer: b) SIGKILL
Explanation: The SIGKILL signal is used to terminate a process and its children immediately in UNIX.
31. What command is used to display information about system processes and their resource usage in a tree-like format in UNIX?
a) ps -t
b) ps -g
c) ps -T
d) ps -H
Answer: d) ps -H
Explanation: The ps command with the -H option is used to display information about system processes and their resource usage in a tree-like format in UNIX.
32. Which signal is used to terminate a process gracefully and allow it to perform cleanup tasks in UNIX?
a) SIGKILL
b) SIGTERM
c) SIGINT
d) SIGHUP
Answer: b) SIGTERM
Explanation: The SIGTERM signal is used to terminate a process gracefully and allow it to perform cleanup tasks in UNIX.
33. What command is used to display information about system processes and their resource usage sorted by memory usage in UNIX?
a) ps -M
b) ps -m
c) ps -mem
d) ps -%MEM
Answer: d) ps -%MEM
Explanation: The ps command with the -%MEM option is used to display information about system processes and their resource usage sorted by memory usage in UNIX.
34. Which command is used to display information about system processes and their resource usage in a wide format in UNIX?
a) ps -w
b) ps -wide
c) ps -l
d) ps -o
Answer: b) ps -wide
Explanation: The ps command with the -wide option is used to display information about system processes and their resource usage in a wide format in UNIX.
35. What is the purpose of the pgrep command in UNIX?
a) Display process groups
b) Find processes based on their attributes
c) Display process priority
d) Display process tree
Answer: b) Find processes based on their attributes
Explanation: The pgrep command is primarily used to find processes based on their attributes in UNIX.
36. Which signal is used to suspend a process temporarily without stopping it in UNIX?
a) SIGTSTP
b) SIGSTOP
c) SIGCONT
d) SIGINT
Answer: a) SIGTSTP
Explanation: The SIGTSTP signal is used to suspend a process temporarily without stopping it in UNIX.
37. What command is used to display information about system processes and their resource usage sorted by process ID in UNIX?
a) ps -pid
b) ps -p
c) ps -i
d) ps -PID
Answer: b) ps -p
Explanation: The ps command with the -p option is used to display information about system processes and their resource usage sorted by process ID in UNIX.
38. Which signal is used to continue the execution of a stopped process in UNIX?
a) SIGCONT
b) SIGSTOP
c) SIGTSTP
d) SIGINT
Answer: a) SIGCONT
Explanation: The SIGCONT signal is used to continue the execution of a stopped process in UNIX.
39. What command is used to display information about system processes and their resource usage sorted by process start time in UNIX?
a) ps -S
b) ps -s
c) ps -start
d) ps -start-time
Answer: a) ps -S
Explanation: The ps command with the -S option is used to display information about system processes and their resource usage sorted by process start time in UNIX.
40. What is the purpose of the pkill command in UNIX?
a) Find and display process IDs
b) Find and terminate processes
c) Find and suspend processes
d) Find and resume processes
Answer: b) Find and terminate processes
Explanation: The pkill command is used to find and terminate processes in UNIX.
41. Which signal is used to send a “hangup” signal to a process in UNIX?
a) SIGHUP
b) SIGINT
c) SIGTERM
d) SIGKILL
Answer: a) SIGHUP
Explanation: The SIGHUP signal is used to send a “hangup” signal to a process in UNIX.
42. What command is used to display information about system processes and their resource usage sorted by user in UNIX?
a) ps -U
b) ps -u
c) ps -user
d) ps -user-sort
Answer: b) ps -u
Explanation: The ps command with the -u option is used to display information about system processes and their resource usage sorted by user in UNIX.
43. Which signal is used to suspend a process temporarily in UNIX?
a) SIGSTOP
b) SIGTSTP
c) SIGCONT
d) SIGINT
Answer: a) SIGSTOP
Explanation: The SIGSTOP signal is used to suspend a process temporarily in UNIX.
44. What command is used to display information about system processes and their resource usage sorted by process name in UNIX?
a) ps -name
b) ps -n
c) ps -comm
d) ps -sort
Answer: c) ps -comm
Explanation: The ps command with the -comm option is used to display information about system processes and their resource usage sorted by process name in UNIX.
45. What is the purpose of the kill command in UNIX?
a) Terminate a process
b) Suspend a process
c) Resume a process
d) Display process information
Answer: a) Terminate a process
Explanation: The kill command is used to terminate a process in UNIX.
46. Which command is used to display information about system processes and their resource usage sorted by virtual memory usage in UNIX?
a) ps -v
b) ps -V
c) ps -mem
d) ps -vsz
Answer: d) ps -vsz
Explanation: The ps command with the -vsz option is used to display information about system processes and their resource usage sorted by virtual memory usage in UNIX.
47. What is the purpose of the nice command in UNIX?
a) Adjust process priority
b) Terminate processes
c) Display CPU usage
d) Display memory usage
Answer: a) Adjust process priority
Explanation: The nice command is used to adjust the priority of processes in UNIX.
48. Which signal is used to terminate a process and its children gracefully by default in UNIX?
a) SIGKILL
b) SIGTERM
c) SIGINT
d) SIGHUP
Answer: b) SIGTERM
Explanation: The SIGTERM signal is used to terminate a process and its children gracefully by default in UNIX.
49. What command is used to display information about system processes and their resource usage sorted by process priority in UNIX?
a) ps -prio
b) ps -pr
c) ps -o
d) ps -ni
Answer: b) ps -pr
Explanation: The ps command with the -pr option is used to display information about system processes and their resource usage sorted by process priority in UNIX.
50. Which command is used to display information about system processes and their resource usage sorted by resident memory usage in UNIX?
a) ps -r
b) ps -rss
c) ps -mem
d) ps -RES
Answer: b) ps -rss
Explanation: The ps command with the -rss option is used to display information about system processes and their resource usage sorted by resident memory usage in UNIX.