File Systems and Directories # MCQs Practice set

Q.1 Which of the following is the primary purpose of a file system?

Manage CPU scheduling
Organize and store data
Handle network communication
Execute instructions
Explanation - A file system is mainly responsible for organizing, storing, and retrieving data on storage devices.
Correct answer is: Organize and store data

Q.2 Which file system is commonly used in Windows operating systems?

EXT4
NTFS
FAT32
HFS+
Explanation - NTFS (New Technology File System) is the standard file system for Windows operating systems.
Correct answer is: NTFS

Q.3 In UNIX, which symbol represents the root directory?

~
/
.
\
Explanation - In UNIX-based systems, '/' represents the root directory, which is the starting point of the directory structure.
Correct answer is: /

Q.4 Which of these is NOT a type of file?

Regular file
Directory file
Device file
Memory file
Explanation - File types include regular, directory, and device files. Memory file is not a standard file type.
Correct answer is: Memory file

Q.5 Which command is used in Linux to list files in a directory?

ls
cd
pwd
cat
Explanation - The 'ls' command is used to list files and directories in Linux/UNIX.
Correct answer is: ls

Q.6 What is the maximum filename length in most modern file systems like NTFS?

64 characters
128 characters
255 characters
1024 characters
Explanation - Most modern file systems, including NTFS, support filenames up to 255 characters.
Correct answer is: 255 characters

Q.7 Which data structure is commonly used by file systems to store file metadata?

Tree
Hash Table
Inode
Stack
Explanation - UNIX-like systems use inodes to store metadata about files such as permissions, ownership, and timestamps.
Correct answer is: Inode

Q.8 Which is an example of a journaling file system?

FAT32
EXT3
CP/M
FAT12
Explanation - EXT3 is a journaling file system that records changes before committing them, helping with recovery.
Correct answer is: EXT3

Q.9 What does the command 'pwd' do in UNIX/Linux?

Prints current working directory
Prints write data
Pauses working device
Processes write delay
Explanation - 'pwd' prints the current working directory path in UNIX/Linux.
Correct answer is: Prints current working directory

Q.10 Which directory in UNIX stores user home directories by default?

/root
/bin
/etc
/home
Explanation - User home directories are typically stored under '/home' in UNIX/Linux.
Correct answer is: /home

Q.11 Which of these is a hierarchical file system?

NTFS
FAT32
EXT4
All of the above
Explanation - All modern file systems like NTFS, FAT32, and EXT4 follow hierarchical structures.
Correct answer is: All of the above

Q.12 In file systems, what does 'mounting' mean?

Installing hardware
Attaching a file system to a directory tree
Copying files
Creating partitions
Explanation - Mounting attaches a file system to a directory structure so that users can access it.
Correct answer is: Attaching a file system to a directory tree

Q.13 Which of the following file systems is primarily used in macOS?

APFS
NTFS
EXT4
FAT32
Explanation - Apple File System (APFS) is the default file system for macOS.
Correct answer is: APFS

Q.14 What is the function of a directory?

Store metadata
Group files together
Execute programs
Increase speed
Explanation - Directories are used to organize and group related files.
Correct answer is: Group files together

Q.15 What does the 'cd' command do in UNIX/Linux?

Creates directory
Changes directory
Copies data
Checks disk
Explanation - The 'cd' command is used to change the current working directory in UNIX/Linux.
Correct answer is: Changes directory

Q.16 Which of the following is a valid absolute path in UNIX?

/usr/bin
bin/usr
~/usr/bin
./bin/usr
Explanation - An absolute path starts from the root '/', so '/usr/bin' is correct.
Correct answer is: /usr/bin

Q.17 Which of these is NOT stored in an inode?

File size
File contents
Timestamps
Ownership
Explanation - Inodes store metadata like size, timestamps, and ownership, but not the actual contents.
Correct answer is: File contents

Q.18 Which file system feature helps recover from crashes quickly?

Compression
Journaling
Caching
Defragmentation
Explanation - Journaling records changes before committing, allowing recovery after crashes.
Correct answer is: Journaling

Q.19 In Windows, which symbol separates directories in a path?

/
\
:
.
Explanation - Windows uses backslashes '\' to separate directories in file paths.
Correct answer is: \

Q.20 Which file allocation method suffers from external fragmentation?

Contiguous allocation
Linked allocation
Indexed allocation
All of the above
Explanation - Contiguous allocation may leave unusable free spaces, causing external fragmentation.
Correct answer is: Contiguous allocation

Q.21 What is the root directory in Windows called?

C:\
/root
/home
system32
Explanation - In Windows, the main root directory is usually 'C:\'.
Correct answer is: C:\

Q.22 Which command creates a new directory in Linux?

mkdir
touch
cat
rmdir
Explanation - 'mkdir' is used to make a new directory in Linux/UNIX.
Correct answer is: mkdir

Q.23 Which of these file systems supports large files over 4GB?

FAT32
NTFS
EXT2
FAT16
Explanation - NTFS supports large files, unlike FAT32 which has a 4GB limit.
Correct answer is: NTFS

Q.24 What is a symbolic link in UNIX?

A hard copy of file
A shortcut pointing to another file
A file stored in memory
A directory alias
Explanation - A symbolic link acts as a shortcut to another file or directory.
Correct answer is: A shortcut pointing to another file

Q.25 Which of the following stores the mapping of file names to inodes in UNIX?

Directory entry
Superblock
File contents
Data block
Explanation - Directory entries store the mapping between filenames and inode numbers.
Correct answer is: Directory entry