Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Chapter: 44
Q1201:
What is the inode in UNIX?
A. A data structure that contains file attributes
B. An algorithm for file allocation
C. A permission for executing a file
D. A file descriptor
Correct Answer:
B
Chapter: 44
Q1202:
What does the umask command do?
A. It sets permissions for an existing file
B. It displays the current mask value
C. It sets the default permissions for newly created files
D. It lists files in a directory
Correct Answer:
C
Chapter: 44
Q1203:
Which method of file space allocation requires each file to occupy contiguous blocks on the disk?
A. Contiguous allocation
B. Linked allocation
C. Indexed allocation
D. Direct allocation
Correct Answer:
A
Chapter: 44
Q1204:
Which of the following is a disadvantage of contiguous file allocation?
A. External fragmentation
B. Slow access to files
C. No random access
D. High overhead
Correct Answer:
A
Chapter: 44
Q1205:
Which space allocation method does not suffer from external fragmentation?
A. Contiguous allocation
B. Linked allocation
C. Indexed allocation
D. Direct allocation
Correct Answer:
B
Chapter: 44
Q1206:
What does the file control block (FCB) store in UNIX?
A. File's contents
B. File's permissions
C. File's inode and other attributes
D. File's name and location
Correct Answer:
C
Chapter: 44
Q1207:
Which of the following commands displays permissions for all files and directories in your home directory?
A. ls –l ~
B. ls –ld ~
C. chmod 755 ~
D. chmod 700 ~
Correct Answer:
A
Chapter: 44
Q1208:
In the chmod 761 game1 command, what permission is granted to the group?
A. Read and write only
B. Execute only
C. Read, write, and execute
D. Read only
Correct Answer:
B
Chapter: 44
Q1209:
What is a major disadvantage of linked allocation?
A. External fragmentation
B. No support for sequential access
C. Slow file growth
D. Inefficient for random access files
Correct Answer:
D
Chapter: 44
Q1210:
Which allocation method is more efficient for supporting direct access to a file?
A. Contiguous allocation
B. Linked allocation
C. Indexed allocation
D. None of the above
Correct Answer:
C
Chapter: 44
Q1211:
Which of the following commands sets the default mask value to octal 022?
A. umask 022
B. umask 755
C. chmod 022
D. chmod 755
Correct Answer:
A
Chapter: 44
Q1212:
Which permission in UNIX allows writing or rewriting data to a file?
A. Read
B. Write
C. Execute
D. Append
Correct Answer:
B
Chapter: 44
Q1213:
What does the 'x' permission in UNIX signify?
A. Execute the file
B. Write to the file
C. Read from the file
D. Append to the file
Correct Answer:
A
Chapter: 44
Q1214:
In UNIX, what does the directory entry for each file contain?
A. File permissions
B. File size and location
C. File control block
D. File's inode pointer
Correct Answer:
B
Chapter: 44
Q1215:
Which of the following is true about the linked allocation method?
A. Supports random access
B. Does not suffer from external fragmentation
C. Uses contiguous blocks
D. Requires file size declaration
Correct Answer:
B
Chapter: 44
Q1216:
In indexed allocation, what is the function of the index block?
A. It stores the file's contents
B. It points to the file's data blocks
C. It stores the file's permissions
D. It contains the file's inode pointer
Correct Answer:
B
Chapter: 44
Q1217:
What is the main advantage of linked allocation over contiguous allocation?
A. No external fragmentation
B. Supports direct access to files
C. Requires less memory space
D. None of the above
Correct Answer:
A
Chapter: 44
Q1218:
Which of the following commands sets the permissions for the home directory to 700?
A. chmod 700 ~
B. umask 700
C. chmod 755 ~
D. chmod 744 ~
Correct Answer:
A
Chapter: 44
Q1219:
When a file is opened in UNIX, where is the pointer to its inode stored?
A. In the directory entry
B. In the system-wide open file table
C. In the file's FCB
D. In the per-process file descriptor table
Correct Answer:
B
Chapter: 44
Q1220:
Fill in the blank: In UNIX, the default permission for text files is ________.
A. 777
B. 666
C. 755
D. 700
Correct Answer:
B