Skip to main content

Stage 1: Curious Diver

You will be introduced to the Linux file system hierarchy and permissions. Build confidence in navigating directories, understanding ownership, and managing access rights - skills that interviewers often test to gauge system administration knowledge.


Hackbook Overview

  • File System Hierarchy: Root /, key directories like /etc, /var, /home, /bin, /usr.
  • File Types: Regular files, directories, symbolic links, devices.
  • Permissions: Read (r), write (w), execute (x).
  • Ownership: User, group, others.
  • Changing Permissions: chmod, chown, chgrp.
  • Why It Matters: Permissions ensure security and proper resource management in multi‑user systems.

Hands‑On Practice

  • Run ls -l / → Explore directory hierarchy.
  • Create a file and check its default permissions: touch test.txt && ls -l test.txt.
  • Change permissions: chmod 755 test.txt.
  • Change ownership: sudo chown user:user test.txt.
  • Create a symbolic link: ln -s test.txt link.txt.

Interview Question Bank

Conceptual

  • Q1. What is the Linux file system hierarchy?
    A1. It starts at root / and organizes directories like /etc (configs), /var (logs), /home (user files), /bin (binaries).
  • Q2. Explain Linux file permissions.
    A2. Permissions control access: read (r), write (w), execute (x). They apply to user, group, and others.
  • Q3. What’s the difference between chmod and chown?
    A3. chmod changes permissions, while chown changes ownership of a file or directory.

Practical

  • Q4. How do you check file permissions?
    A4. Use ls -l filename. Example output: -rw-r--r-- shows read/write for user, read for group/others.
  • Q5. How do you give execute permission to a script?
    A5. Run chmod +x script.sh.
  • Q6. How do you change ownership of a file to another user?
    A6. Run sudo chown newuser filename.

Scenario‑Based

  • Q7. A script fails with “Permission denied.” How do you fix it?
    A7. Grant execute permission: chmod +x script.sh.
  • Q8. A file should be readable only by its owner. How do you set that?
    A8. Run chmod 600 filename.
  • Q9. You need to allow a group to edit a shared file. How do you do it?
    A9. Add group write permission: chmod g+w filename.

Behavioral Based

  • Q10. Tell me about a time you solved a permissions issue.
    A10. Example: “I once fixed a deployment error by adjusting script permissions with chmod +x, enabling smooth execution.”

Cheatsheet (Quick Notes)

  • Directories: /etc configs, /var logs, /home users, /bin binaries.
  • Permissions: r read, w write, x execute.
  • Ownership: User, group, others.
  • Commands: ls -l, chmod, chown, chgrp.
  • Numeric Permissions: 644 (rw‑r‑‑r‑‑), 755 (rwxr‑xr‑x).

Tips, Tricks, Roadmaps, Resources, Networking, Motivation, Guidance, and Cool Stuff ♥

Updated on Dec 21, 2025