Explore key concepts of Linux filesystem structure and navigation commands with this quiz designed to strengthen your understanding of directories, file paths, permissions, and common navigational tools. Ideal for users seeking to build practical foundational skills in Linux environments.
In a Linux filesystem, what is the main purpose of the root directory represented by '/'?
Explanation: The '/' directory is the root of the Linux filesystem, meaning all other files and folders are found under it. It does not specifically store only configuration files, which are often found in '/etc' (option B). A user's home directory is typically '/home/username', not the root (option C). Temporary files are usually placed in '/tmp', not directly in the root directory (option D).
Which command would change the current working directory to its parent directory in Linux?
Explanation: Using 'cd ..' navigates up one level to the parent directory relative to your current location. 'cd /' would move you to the root directory, not necessarily the parent (option B). 'cd ~' takes you to your home directory (option C). 'cd //' tries to access the double-slash path, which is not standard for parent navigation (option D).
Given the current directory is '/home/student', which path is an example of a relative path to access a file called 'notes.txt' inside '/home/student/docs'?
Explanation: A relative path specifies the location of a file in relation to the current directory, so 'docs/notes.txt' would reach 'notes.txt' inside 'docs' from '/home/student'. The full path '/home/student/docs/notes.txt' is an absolute path (option B). '~/docs/notes.txt' references the home directory using tilde, not the current directory (option C). '/docs/notes.txt' points to 'docs' in the root directory, not under 'home/student' (option D).
Which Linux command, when executed in a directory, will display all files including those starting with a dot (hidden files)?
Explanation: The 'ls -a' command displays all files, including hidden files that start with a dot. 'ls -h' provides human-readable file sizes but does not include hidden files (option B). 'ls -lS' lists files by size in long format but omits hidden ones (option C). 'ls —all' appears similar, but the correct syntax is with a single dash and no em dash; '--all' only works as a double-hyphen, so the given option D is a common typo (option D).
When you run 'ls -l', what does the string 'drwxr-xr-x' at the start of a line signify about a directory's permissions?
Explanation: 'drwxr-xr-x' means it's a directory (d), the owner can read, write, and execute, while group and others can read and execute but not write. It is accessible by anyone to read and enter, with write access reserved for the owner. Option B is incorrect, as there is nothing indicating root-only access. Hidden files typically start their name with a dot, not with these permissions (option C). Option D reverses permission roles, which is not implied here.