UNIX MCQs – System Monitoring (Part – 4)

UNIX Question and Answer – System Monitoring

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

1. What does the “nmon” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Monitor disk I/O statistics

d) Monitor memory usage

Answer: a) Monitor CPU usage

Explanation: The “nmon” command is used to monitor various system resources, including CPU usage, memory usage, disk I/O, and network statistics.


2. Which option of the “nmon” command is used to specify the interval for data collection?

a) -i

b) -n

c) -t

d) -s

Answer: a) -i

Explanation: The “nmon” command with the “-i” option is used to specify the interval for data collection.


3. What does the “iostat” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Monitor disk I/O statistics

d) Monitor memory usage

Answer: c) Monitor disk I/O statistics

Explanation: The “iostat” command is used to monitor input/output statistics for block devices and partitions.


4. Which option of the “iostat” command is used to display statistics for specific devices?

a) -d

b) -n

c) -t

d) -p

Answer: a) -d

Explanation: The “iostat” command with the “-d” option is used to display statistics for specific block devices.


5. What does the “iotop” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Monitor disk I/O statistics

d) Monitor memory usage

Answer: c) Monitor disk I/O statistics

Explanation: The “iotop” command is used to monitor disk I/O usage by individual processes in real-time.


6. Which option of the “iotop” command is used to display accumulated disk I/O?

a) -a

b) -u

c) -p

d) -n

Answer: a) -a

Explanation: The “iotop” command with the “-a” option displays accumulated disk I/O.


7. What does the “vmstat” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Monitor virtual memory statistics

d) Monitor memory usage

Answer: c) Monitor virtual memory statistics

Explanation: The “vmstat” command is used to monitor virtual memory statistics, including memory usage, paging, and block I/O.


8. Which option of the “vmstat” command is used to specify the interval for data collection?

a) -i

b) -n

c) -t

d) -S

Answer: b) -n

Explanation: The “vmstat” command with the “-n” option is used to specify the interval for data collection.


9. What does the “sar” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Monitor system activity

d) Monitor memory usage

Answer: c) Monitor system activity

Explanation: The “sar” command is used to collect, report, and save system activity information, including CPU, memory, disk, and network usage.


10. Which option of the “sar” command is used to specify the interval for data collection?

a) -i

b) -n

c) -t

d) -u

Answer: c) -t

Explanation: The “sar” command with the “-t” option is used to specify the interval for data collection.


11. What does the “dstat” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Monitor disk I/O statistics

d) Monitor memory usage

Answer: a) Monitor CPU usage

Explanation: The “dstat” command is used to monitor system resources such as CPU, memory, disk, and network usage in real-time.


12. Which option of the “dstat” command is used to display CPU statistics?

a) -c

b) -n

c) -d

d) -m

Answer: a) -c

Explanation: The “dstat” command with the “-c” option is used to display CPU statistics.


13. What does the “pidstat” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Monitor disk I/O statistics

d) Monitor memory usage

Answer: a) Monitor CPU usage

Explanation: The “pidstat” command is used to monitor CPU usage by individual processes.


14. Which option of the “pidstat” command is used to specify the interval for data collection?

a) -i

b) -n

c) -t

d) -p

Answer: a) -i

Explanation: The “pidstat” command with the “-i” option is used to specify the interval for data collection.


15. What does the “mpstat” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Monitor disk I/O statistics

d) Monitor memory usage

Answer: a) Monitor CPU usage

Explanation: The “mpstat” command is used to monitor CPU usage on multiprocessor systems.


16. Which option of the “mpstat” command is used to display statistics for a specific processor?

a) -p

b) -n

c) -t

d) -u

Answer: a) -p

Explanation: The “mpstat” command with the “-p” option is used to display statistics for a specific processor.


17. What does the “pidof” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Identify the PID of a process

d) Monitor memory usage

Answer: c) Identify the PID of a process

Explanation: The “pidof” command is used to identify the PID of a running process by its name.


18. Which option of the “pidof” command is used to find the PID of multiple processes?

a) -s

b) -o

c) -c

d) -x

Answer: d) -x

Explanation: The “pidof” command with the “-x” option is used to find the PID of multiple processes.


19. What does the “htop” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Monitor disk I/O statistics

d) Monitor memory usage

Answer: a) Monitor CPU usage

Explanation: The “htop” command is an interactive process viewer that displays CPU usage, memory usage, and other system information.


20. Which key is used to kill a process in “htop”?

a) F9

b) F5

c) F10

d) F8

Answer: c) F10

Explanation: Pressing F10 in “htop” brings up a menu to kill processes.


21. What does the “atop” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Monitor disk I/O statistics

d) Monitor memory usage

Answer: a) Monitor CPU usage

Explanation: The “atop” command is used to monitor CPU, memory, disk, and network activity in real-time.


22. Which key is used to switch between CPU and memory views in “atop”?

a) M

b) C

c) D

d) N

Answer: b) C

Explanation: Pressing the “C” key in “atop” switches between CPU and memory views.


23. What does the “glances” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Monitor disk I/O statistics

d) Monitor memory usage

Answer: a) Monitor CPU usage

Explanation: The “glances” command is used to monitor system resources such as CPU, memory, disk, and network usage in real-time.


24. Which key is used to sort processes by CPU usage in “glances”?

a) c

b) m

c) p

d) s

Answer: a) c

Explanation: Pressing the “c” key in “glances” sorts processes by CPU usage.


55. What does the “ncdu” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Analyze disk usage

d) Monitor memory usage

Answer: c) Analyze disk usage

Explanation: The “ncdu” command is used to analyze disk usage and display a tree-like structure of directories sorted by size.


26. Which key is used to navigate up one directory level in “ncdu”?

a) Up arrow

b) Down arrow

c) Left arrow

d) Right arrow

Answer: c) Left arrow

Explanation: Pressing the left arrow key in “ncdu” navigates up one directory level.


27. What does the “htop” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) Monitor disk I/O statistics

d) Monitor memory usage

Answer: a) Monitor CPU usage

Explanation: The “htop” command is an interactive process viewer that displays CPU usage, memory usage, and other system information.


28. Which key is used to search for a process in “htop”?

a) /

b)

c) S

d) F

Answer: a) /

Explanation: Pressing the “/” key in “htop” allows you to search for a process by name.


29. What does the “ps” command do in UNIX?

a) Monitor CPU usage

b) Display system logs

c) List running processes

d) Monitor memory usage

Answer: c) List running processes

Explanation: The “ps” command is used to display information about running processes.


30. Which option of the “ps” command is used to display information about all processes?

a) -a

b) -e

c) -l

d) -x

Answer: b) -e

Explanation: The “ps” command with the “-e” option displays information about all processes.


31. What does the “pgrep” command do in UNIX?

a) Monitor CPU usage

b) Display system logs

c) List running processes

d) Search for processes by name

Answer: d) Search for processes by name

Explanation: The “pgrep” command searches for processes by name and displays their PIDs.


32. Which option of the “pgrep” command is used to invert the matching criteria?

a) -i

b) -v

c) -f

d) -x

Answer: b) -v

Explanation: The “pgrep” command with the “-v” option inverts the matching criteria.


33. What does the “kill” command do in UNIX?

a) Monitor CPU usage

b) Terminate processes

c) List running processes

d) Monitor memory usage

Answer: b) Terminate processes

Explanation: The “kill” command is used to terminate processes by sending a signal to the specified PID.


34. Which signal is sent by default when using the “kill” command?

a) SIGKILL

b) SIGTERM

c) SIGSTOP

d) SIGCONT

Answer: b) SIGTERM

Explanation: The “kill” command sends the SIGTERM signal by default, allowing processes to perform cleanup before termination.


35. What does the “top” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) List running processes

d) Monitor memory usage

Answer: c) List running processes

Explanation: The “top” command displays a dynamic real-time view of system processes and their resource usage.


36. Which key is used to kill a process in “top”?

a) k

b) d

c) q

d) x

Answer: k

Explanation: Pressing the “k” key in “top” prompts you to enter the PID of the process you want to kill.


37. What does the “watch” command do in UNIX?

a) Monitor CPU usage

b) Execute a command periodically

c) List running processes

d) Monitor memory usage

Answer: b) Execute a command periodically

Explanation: The “watch” command runs a specified command repeatedly, displaying its output in real-time.


38. Which option of the “watch” command is used to specify the update interval?

a) -i

b) -n

c) -t

d) -u

Answer: b) -n

Explanation: The “watch” command with the “-n” option is used to specify the update interval.


39. What does the “lwatch” command do in UNIX?

a) Monitor CPU usage

b) Monitor network traffic

c) List running processes

d) Monitor memory usage

Answer: a) Monitor CPU usage

Explanation: The “lwatch” command is a lightweight alternative to “watch” that monitors CPU usage.


40. Which key is used to exit “lwatch”?

a) q

b) x

c) Esc

d) Ctrl+C

Answer: d) Ctrl+C

Explanation: Pressing Ctrl+C exits the “lwatch” command.


41. What does the “uptime” command do in UNIX?

a) Monitor CPU usage

b) Display system uptime and load average

c) List running processes

d) Monitor memory usage

Answer: b) Display system uptime and load average

Explanation: The “uptime” command displays the system uptime and current load average.


42. What information does the load average indicate in the output of the “uptime” command?

a) CPU usage percentage

b) Number of running processes

c) System responsiveness over the last 1, 5, and 15 minutes

d) Memory usage statistics

Answer: c) System responsiveness over the last 1, 5, and 15 minutes

Explanation: The load average displayed by the “uptime” command indicates the system’s responsiveness over the last 1, 5, and 15 minutes.


43. What does the “sar” command primarily monitor?

a) CPU usage

b) Disk I/O statistics

c) Network traffic

d) System activity

Answer: d) System activity

Explanation: The “sar” command primarily monitors system activity, including CPU, memory, disk, and network usage.


44. Which option of the “sar” command is used to display CPU statistics?

a) -c

b) -d

c) -n

d) -u

Answer: d) -u

Explanation: The “sar” command with the “-u” option is used to display CPU statistics.


45. What does the “vmstat” command display?

a) Disk I/O statistics

b) Memory usage statistics

c) Network traffic

d) System uptime

Answer: b) Memory usage statistics

Explanation: The “vmstat” command displays memory usage statistics, including virtual memory, paging, and block I/O.


46. Which option of the “vmstat” command is used to specify the update interval?

a) -i

b) -n

c) -t

d) -S

Answer: b) -n

Explanation: The “vmstat” command with the “-n” option is used to specify the update interval.


47. What does the “pidstat” command primarily monitor?

a) CPU usage

b) Disk I/O statistics

c) Memory usage

d) Network traffic

Answer: a) CPU usage

Explanation: The “pidstat” command primarily monitors CPU usage by individual processes.


48. Which option of the “pidstat” command is used to display memory statistics?

a) -m

b) -d

c) -p

d) -u

Answer: a) -m

Explanation: The “pidstat” command with the “-m” option is used to display memory statistics.


49. What does the “iostat” command primarily monitor?

a) CPU usage

b) Disk I/O statistics

c) Memory usage

d) Network traffic

Answer: b) Disk I/O statistics

Explanation: The “iostat” command primarily monitors disk I/O statistics for block devices and partitions.


50. Which option of the “iostat” command is used to display extended statistics?

a) -e

b) -x

c) -l

d) -t

Answer: b) -x

Explanation: The “iostat” command with the “-x” option is used to display extended statistics.

Related Articles

Linux MCQ

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