File systems basics
Computer Science · Computer architecture & systems
Question 1 of 10
0The cat command is used to:
Stuck? Read the explanation
Unlocks at a streak of 5 correct answers in a row.
Embed this practice on your site or class page
Paste this HTML into your page. Students practise right there; it is free and needs no account.
File systems basics explained
A file system is the part of an operating system that organises how files are named, stored and found on a storage device. It keeps track of which files exist, where their data is on the disk, and which parts of the disk are free. Files are usually arranged in folders, also called directories, which can hold other folders in a tree structure.
Storage devices store data in small fixed-size blocks. A file can be spread across many blocks, and those blocks do not have to be next to each other. The file system records the list of blocks for each file, so that it can find all of the file's data when the file is opened.
Each file also has metadata, which is data about the file, such as its name, size, date of last change and permissions. A path describes where a file sits in the tree of folders. An absolute path starts from the root folder, for example /home/alex/notes.txt, while a relative path starts from the current folder.
A common mistake is to think a file takes up exactly its size on disk. Because data is stored in whole blocks, a file usually uses slightly more space than its size, and the unused part of its last block is wasted.
Worked example
A file system uses blocks of 4096 bytes, and a file is 10000 bytes long.
- Blocks needed: , so the file needs 3 blocks.
- Space used: bytes.
- Wasted space: bytes in the last block.
Check: two full blocks hold 8192 bytes, which leaves 1808 bytes for the third block.
What you will practise
105 multiple-choice questions (Easy, Medium, Hard). Each answer is followed by an explanation.
Example questions
- A file system:
- A directory is also called a:
- File paths describe:
- Permissions control:
- Fragmentation:
- An inode mainly stores:
- The root directory of a Unix-like file system is written as:
- A symbolic link is:
…and 97 more.