Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Chapter: 10
Q261:
Which of the following is true about FIFOs in UNIX/Linux?
A. FIFOs require a process to be created each time they are used
B. FIFOs are destroyed once a process using them exits
C. FIFOs are used only between related processes
D. FIFOs cannot be opened for writing
Correct Answer:
B
Chapter: 10
Q262:
A named pipe (FIFO) can be created using:
A. mknod() and mkfifo()
B. mkfifo() and open()
C. ls and mkfifo()
D. open() and read()
Correct Answer:
A
Chapter: 10
Q263:
In the following command: "$ find ~ -name foo -print 2> errors", what is redirected to the file 'errors'?
A. Standard input
B. Standard output
C. Error messages
D. Error data
Correct Answer:
C
Chapter: 10
Q264:
The 'tee' command in UNIX/Linux is used to:
A. Redirect error messages to a file
B. Redirect output to a file and the display
C. Redirect standard input
D. Redirect standard output to a file
Correct Answer:
B
Chapter: 10
Q265:
The command "command 1> output-file" redirects:
A. Standard input
B. Standard output
C. Error messages
D. Standard error
Correct Answer:
B
Chapter: 10
Q266:
Which function is used to create a FIFO in C?
A. mknod()
B. mkfifo()
C. open()
D. write()
Correct Answer:
B
Chapter: 10
Q267:
Which operator is used for error redirection in UNIX/Linux?
A. 0<
B. 1>
C. 2>
D. |
Correct Answer:
C
Chapter: 11
Q268:
Which command is used to display the status of processes in UNIX/Linux?
A. ps
B. ls
C. top
D. mkdir
Correct Answer:
A
Chapter: 11
Q269:
The server process in the client-server model creates which two FIFO files?
A. FIFO1 and FIFO2
B. FIFO1 and FIFO3
C. FIFO2 and FIFO3
D. FIFO4 and FIFO5
Correct Answer:
A
Chapter: 11
Q270:
In the provided example, what is the first message that the client sends to the server?
A. Hello, world!
B. Hello, class!
C. Good morning!
D. Goodbye!
Correct Answer:
A
Chapter: 11
Q271:
What does the 'ps -u root' command display?
A. Processes owned by the root user
B. All processes running on the system
C. Processes owned by the current user
D. Processes in background
Correct Answer:
A
Chapter: 11
Q272:
In the client-server example, what does the server do after receiving a message from the client?
A. It displays the message and sends a response
B. It terminates the connection
C. It creates new FIFO files
D. It waits for another client
Correct Answer:
B
Chapter: 11
Q273:
Which system call is used to create a FIFO in UNIX/Linux?
A. mknod
B. mkfifo
C. open
D. pipe
Correct Answer:
A
Chapter: 11
Q274:
What is the purpose of the 'top' command in UNIX/Linux?
A. Display CPU usage of processes
B. Display list of files
C. Display current directory
D. List active users
Correct Answer:
A
Chapter: 11
Q275:
Which FIFO does the client write the message to?
A. FIFO1
B. FIFO2
C. FIFO3
D. FIFO4
Correct Answer:
A
Chapter: 11
Q276:
Which function is used to remove a FIFO in UNIX/Linux?
A. unlink
B. mknod
C. rm
D. open
Correct Answer:
A
Chapter: 11
Q277:
What is the file permission set for the FIFOs in the provided example?
A. 644
B. 666
C. 777
D. 600
Correct Answer:
B
Chapter: 11
Q278:
What is the purpose of the 'ps -e' command?
A. Display all processes running on the system
B. Display only processes of the current user
C. Display processes in long format
D. Display processes of root user
Correct Answer:
A
Chapter: 11
Q279:
What does the 'top' command show about the system?
A. CPU usage, memory usage, and process information
B. Only running processes
C. Only CPU usage
D. Memory usage of each user
Correct Answer:
A
Chapter: 11
Q280:
Which command displays the top processes based on CPU usage in real-time?
A. ps
B. top
C. kill
D. ls
Correct Answer:
B