Linux Basics: Filesystem u0026 Navigation Quiz Quiz

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.

  1. Understanding the Root Directory

    In a Linux filesystem, what is the main purpose of the root directory represented by '/'?

    1. It serves as the top-level directory containing all other directories and files.
    2. It stores only system configuration files for administrators.
    3. It represents a user's personal home directory.
    4. It refers to a hidden directory for temporary files.

    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).

  2. Navigating Directories with cd

    Which command would change the current working directory to its parent directory in Linux?

    1. cd //
    2. cd /
    3. cd ..
    4. cd ~

    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).

  3. Distinguishing Absolute vs Relative Paths

    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'?

    1. ~/docs/notes.txt
    2. /docs/notes.txt
    3. docs/notes.txt
    4. /home/student/docs/notes.txt

    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).

  4. Listing Files Including Hidden Ones

    Which Linux command, when executed in a directory, will display all files including those starting with a dot (hidden files)?

    1. ls -h
    2. ls —all
    3. ls -a
    4. ls -lS

    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).

  5. Understanding File Permissions Syntax

    When you run 'ls -l', what does the string 'drwxr-xr-x' at the start of a line signify about a directory's permissions?

    1. It is a directory readable and executable by everyone; the owner can also write to it.
    2. It is a directory that can be written by anyone but only read by the owner.
    3. It is a hidden file with no permissions set.
    4. It is a file only accessible by the root user.

    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.