Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Multiple Choice Questions
Q251: Which of the following can be used to detach stdout from the display screen in UNIX/Linux?
- A: command < input-file
- B: command > output-file
- C: command 2> error-file
- D: command | output-file
View Answer
B
Q252: When a process writes to a FIFO and no process is reading from it, what signal is sent?
- A: SIGPIPE
- B: SIGTERM
- C: SIGKILL
- D: SIGINT
View Answer
A
Q253: In which situation would the ‘mkfifo’ command fail?
- A: When creating a FIFO with a valid path
- B: When the destination directory is read-only
- C: When the file permissions are correct
- D: When the FIFO is empty
View Answer
B
Q254: A FIFO can be used for communication between:
- A: Only processes on the same machine
- B: Only processes in the same directory
- C: Any processes regardless of relationship
- D: Only related processes
View Answer
C
Q255: Which command can be used to create a FIFO from the command line in UNIX/Linux?
- A: mknod
- B: grep
- C: mkfifo
- D: cat
View Answer
C
Q256: In a UNIX/Linux shell, what happens when a command writes to a FIFO that no process has opened for reading?
- A: It waits for input
- B: An EOF is sent
- C: A SIGPIPE signal is sent
- D: The process is suspended
View Answer
C
Q257: Which of the following is not a valid redirection operator in UNIX/Linux?
- A: <
- B: >
- C: 2>
- D: |
View Answer
C
Q258: Which system call is used to create a special file or FIFO in UNIX/Linux?
- A: mknod()
- B: mkfifo()
- C: pipe()
- D: open()
View Answer
A
Q259: In UNIX/Linux, what is the default mode of operation when opening a FIFO?
- A: Non-blocking I/O
- B: Blocking I/O
- C: Immediate I/O
- D: Asynchronous I/O
View Answer
B
Q260: What is the purpose of using FIFOs in client-server applications in UNIX/Linux?
- A: For fast file transfers
- B: For inter-process communication
- C: To manage file permissions
- D: To create files with special permissions
View Answer
B