Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Chapter: 42
Q1141:
What is the key benefit of using a tree directory structure in UNIX?
A. Easy file access
B. Allows user-defined directories
C. Efficient searching
D. Minimizes disk space usage
Correct Answer:
C
Chapter: 42
Q1142:
Which of the following file extensions in UNIX is used for executable files?
A. .txt
B. .exe
C. .sh
D. .c
Correct Answer:
B
Chapter: 42
Q1143:
Which system call is used to close a file in UNIX?
A. close
B. unlink
C. write
D. read
Correct Answer:
A
Chapter: 42
Q1144:
In UNIX, the __________ system call is used to search for a file in a directory.
A. opendir
B. readdir
C. rewinddir
D. ls
Correct Answer:
A
Chapter: 42
Q1145:
The protection attribute of a file determines __________.
A. Who can execute the file
B. Who can access the file
C. Who can write to the file
D. All of the above
Correct Answer:
D
Chapter: 42
Q1146:
Which of the following is not a directory operation in UNIX?
A. open
B. create
C. read
D. change directory
Correct Answer:
B
Chapter: 42
Q1147:
In UNIX, a symbolic link is represented by the __________ file type.
A. link
B. file
C. symbolic file
D. directory
Correct Answer:
C
Chapter: 42
Q1148:
The __________ file type in UNIX allows communication between processes on different computers.
A. socket
B. ordinary file
C. FIFO
D. block-special file
Correct Answer:
A
Chapter: 42
Q1149:
Which system call is used to create a symbolic link in UNIX?
A. ln
B. ln -s
C. mkfifo
D. mknod
Correct Answer:
B
Chapter: 42
Q1150:
Which type of file in UNIX corresponds to block-oriented devices such as disks?
A. Character-special file
B. Socket
C. Block-special file
D. Directory
Correct Answer:
C
Chapter: 42
Q1151:
Which file access method reads and writes data in order, one record after the other?
A. Sequential access
B. Random access
C. Direct access
D. Sequential write
Correct Answer:
A
Chapter: 42
Q1152:
A file in UNIX/Linux can be opened using the __________ system call.
A. open
B. close
C. read
D. write
Correct Answer:
A
Chapter: 42
Q1153:
In UNIX, the 'pwd' command is used to display __________.
A. The current directory
B. The root directory
C. The parent directory
D. The home directory
Correct Answer:
A
Chapter: 42
Q1154:
Which of the following is an example of an absolute pathname in UNIX?
A. /home/user/documents
B. ~user/documents
C. ./a.out
D. ../../bin
Correct Answer:
A
Chapter: 42
Q1155:
What is a directory structure used for in an operating system?
A. Storing file names and paths
B. Managing file permissions
C. Handling file operations
D. Executing file commands
Correct Answer:
A
Chapter: 42
Q1156:
In UNIX, the 'unlink' system call is used to __________.
A. Delete a file
B. Create a file
C. Write to a file
D. Open a file
Correct Answer:
A
Chapter: 42
Q1157:
Which of the following is a file attribute in an operating system?
A. Access mode
B. Directory name
C. File name
D. Password
Correct Answer:
A
Chapter: 42
Q1158:
The 'ls' command in UNIX is used to __________.
A. List files in a directory
B. Change directories
C. Create directories
D. Delete files
Correct Answer:
A
Chapter: 42
Q1159:
Which file type is used in UNIX to allow communication between processes?
A. FIFO
B. Directory
C. Block-special file
D. Character-special file
Correct Answer:
A
Chapter: 42
Q1160:
Files in UNIX are considered as __________ of bytes.
A. Sequences
B. Records
C. Chunks
D. Structures
Correct Answer:
A