Quiz: File System Fundamentals
Test your understanding of the Linux file system hierarchy and navigation commands.
1. What is the root directory in Linux?
- /home
- /root
- /
- C:\
Show Answer
The correct answer is C. The root directory / is the top of the Linux file system hierarchy. All other directories and files branch from it. Don't confuse this with /root (the root user's home directory) or the root user account.
Concept Tested: Root Directory
2. What is the difference between an absolute path and a relative path?
- Absolute paths are faster to type
- Absolute paths start from /; relative paths start from current directory
- Relative paths only work in scripts
- There is no difference
Show Answer
The correct answer is B. An absolute path specifies the complete location from the root directory (e.g., /home/dan/Documents/file.txt). A relative path specifies location relative to the current directory (e.g., Documents/file.txt if you're in /home/dan).
Concept Tested: Absolute Path, Relative Path
See: Chapter 4 - Paths
3. What does the pwd command display?
- Password information
- Power consumption data
- Print working directory (current location)
- Previous working directory
Show Answer
The correct answer is C. The pwd command (print working directory) displays the absolute path of your current location in the file system. It's useful when you need to know exactly where you are, especially after navigating with relative paths.
Concept Tested: Pwd Command
4. What does cd .. do?
- Changes to the home directory
- Changes to the root directory
- Moves up one directory (parent directory)
- Changes to the previous directory
Show Answer
The correct answer is C. The .. represents the parent directory, so cd .. moves you up one level in the directory hierarchy. For example, if you're in /home/dan/Documents, running cd .. takes you to /home/dan.
Concept Tested: Parent Directory, Cd Command
5. What shortcut represents your home directory?
- @
- ~
- $
Show Answer
The correct answer is C. The tilde ~ represents your home directory. So cd ~ takes you home, ~/Documents refers to the Documents folder in your home directory, and ~dan refers to the home directory of user "dan."
Concept Tested: Home Directory
6. What does the ls -l command show?
- Only hidden files
- Long format with permissions, owner, size, and date
- Files sorted by size
- Only directories
Show Answer
The correct answer is B. The -l flag shows the "long" listing format, which displays permissions, number of links, owner, group, file size, modification date, and filename for each item. This provides much more information than a simple ls.
Concept Tested: Ls Command, Ls Options
7. What are hidden files in Linux?
- Files stored in a secret partition
- Files whose names start with a dot (.)
- Files without read permissions
- Encrypted files
Show Answer
The correct answer is B. Hidden files (also called dot files) are any files or directories whose names begin with a period (.). Examples include .bashrc and .config. Use ls -a to show hidden files. They're typically used for configuration files.
Concept Tested: Hidden Files, Dot Files
8. What is stored in the /etc directory?
- User home directories
- System-wide configuration files
- Temporary files
- User-installed programs
Show Answer
The correct answer is B. The /etc directory contains system-wide configuration files. Examples include /etc/passwd (user accounts), /etc/hosts (network hosts), and /etc/fstab (filesystem mounts). The name historically stands for "editable text configuration."
Concept Tested: Etc Directory
9. What does the tree command display?
- Information about plant species
- A visual tree structure of directories and files
- Family tree of Linux distributions
- Process hierarchy
Show Answer
The correct answer is B. The tree command displays a visual tree structure showing directories and their contents in a hierarchical format. It's great for understanding directory structure at a glance. Use tree -L 2 to limit depth.
Concept Tested: Tree Command
10. What is the purpose of the /tmp directory?
- Storing important permanent files
- Holding temporary files that are cleared on reboot
- Template files for new users
- System backup storage
Show Answer
The correct answer is B. The /tmp directory stores temporary files that programs create during operation. These files are typically cleared when the system reboots. Any user can write to /tmp, making it useful for temporary data but not for permanent storage.
Concept Tested: Tmp Directory