askesis

Linux filesystem basics: 50 directories and files

Learn the Linux directory tree: what /etc, /var, /usr, /proc and /dev are for, plus passwd, shadow, fstab and hosts. Free flashcards, no signup.

IT & DevOpsBeginner50 cardsFree

Practice now

Study without an account

0 of 50 seen0 graduated
What is / for?

Scheduled with the default Askesis timings. Progress is saved in this browser.

All 50 cards

  1. 1
    What is / for?
    The root directory: the top of the single directory tree, where every absolute path starts.
    Not to be confused with /root, the root user’s home.
  2. 2
    What is /bin for?
    Essential commands for all users, needed even to boot and repair the system (ls, cp, cat).
    On current distributions it’s a symlink to /usr/bin (the usr merge).
  3. 3
    What is /sbin for?
    Essential system administration commands (fsck, mkfs, reboot).
    Mostly for root. A symlink to /usr/sbin on merged systems.
  4. 4
    What is /boot for?
    What’s needed to boot: the kernel (vmlinuz), the initramfs and the GRUB bootloader files.
    Often a small separate partition.
  5. 5
    What is /dev for?
    Device files: the interface to hardware and pseudo-devices (/dev/sda, /dev/null).
    Created dynamically by the kernel and udev as devices appear.
  6. 6
    What is /etc for?
    System-wide configuration files, in plain text.
    Host-specific and static: configuration only, no programs. /etc/passwd, /etc/fstab, /etc/hosts…
  7. 7
    What is /home for?
    The home directories of regular users, e.g. /home/alice.
    Often a separate partition or network share, so users’ data survives a reinstall.
  8. 8
    What is /root for?
    The home directory of the root user.
    Kept on the root filesystem, so it’s there even when /home isn’t mounted.
  9. 9
    What is /lib for?
    The essential shared libraries for the commands in /bin and /sbin, and the kernel modules (/lib/modules).
    /lib64 holds the 64-bit libraries on some distributions. A symlink to /usr/lib on merged systems.
  10. 10
    What is /media for?
    Mount points for removable media such as USB sticks and DVDs, usually created automatically.
    e.g. /media/alice/USBSTICK. Contrast /mnt, for manual mounts.
  11. 11
    What is /mnt for?
    A place for temporary filesystems the administrator mounts by hand.
    e.g. mount /dev/sdb1 /mnt for a quick look. Removable media go in /media.
  12. 12
    What is /opt for?
    Self-contained add-on software from third parties, each package in its own subdirectory.
    e.g. /opt/google/chrome. Software you build yourself goes in /usr/local instead.
  13. 13
    What is /proc for?
    A virtual filesystem with kernel and process information: one numbered directory per running process.
    Nothing in it is on disk: /proc/cpuinfo is generated when you read it.
  14. 14
    What is /tmp for?
    Temporary files for any user; may be emptied at reboot.
    World-writable with the sticky bit, so users can delete only their own files. Contrast /var/tmp.
  15. 15
    What is /usr for?
    The second hierarchy: the bulk of installed, read-only software (programs, libraries, documentation).
    It has its own bin, sbin, lib, share and local.
  16. 16
    What is /var for?
    Variable data that changes while the system runs: logs, spools, caches, databases.
    var = variable data, not variables.
  17. 17
    What is /var/log for?
    The log files of the system and its services.
    e.g. syslog or messages, auth.log or secure. The systemd journal is read with journalctl.
  18. 18
    What is /etc/passwd?
    One line per user account: name, password placeholder, UID, GID, comment, home directory, login shell.
    World-readable. An x in the password field means the hash is in /etc/shadow.
  19. 19
    What is /etc/shadow?
    The users’ password hashes and password-aging data, readable only by root.
    Change aging with chage, passwords with passwd.
  20. 20
    What is /etc/group?
    The groups: group name, GID and the list of members.
  21. 21
    What is ~/.bashrc?
    Your personal startup file for every interactive shell: aliases, functions, prompt.
    Apply changes to the current shell with source ~/.bashrc.
  22. 22
    What is /etc/fstab?
    The filesystems to mount at boot: device, mount point, type, options, dump and fsck order.
    A manual mount is lost at reboot; an /etc/fstab entry is persistent.
  23. 23
    What is /etc/hosts?
    Static hostname-to-IP mappings, checked before DNS by default.
  24. 24
    What is /etc/hostname?
    The system’s hostname.
    hostnamectl set-hostname writes it.
  25. 25
    What is /dev/null?
    The bit bucket: discards everything written to it; reading it gives end-of-file.
    e.g. find / -name x 2> /dev/null hides the error messages.
  26. 26
    Which directory is the top of the whole tree, where every absolute path starts?
    /
    Not to be confused with /root, the root user’s home.
  27. 27
    Which top-level directory holds the essential commands every user needs, such as ls and cp?
    /bin
    On current distributions it’s a symlink to /usr/bin (the usr merge).
  28. 28
    Which top-level directory holds the essential system administration commands, such as fsck and mkfs?
    /sbin
    Mostly for root. A symlink to /usr/sbin on merged systems.
  29. 29
    Which directory holds the kernel image, the initramfs and the bootloader files?
    /boot
    Often a small separate partition.
  30. 30
    Which directory holds the device files, such as /dev/sda and /dev/null?
    /dev
    Created dynamically by the kernel and udev as devices appear.
  31. 31
    Which directory holds the system-wide configuration files?
    /etc
    Host-specific and static: configuration only, no programs. /etc/passwd, /etc/fstab, /etc/hosts…
  32. 32
    Which directory holds the regular users’ home directories?
    /home
    Often a separate partition or network share, so users’ data survives a reinstall.
  33. 33
    Which directory is the root user’s home?
    /root
    Kept on the root filesystem, so it’s there even when /home isn’t mounted.
  34. 34
    Which top-level directory holds the essential shared libraries and the kernel modules?
    /lib
    /lib64 holds the 64-bit libraries on some distributions. A symlink to /usr/lib on merged systems.
  35. 35
    Under which directory are removable media such as USB sticks mounted automatically?
    /media
    e.g. /media/alice/USBSTICK. Contrast /mnt, for manual mounts.
  36. 36
    Which directory is meant for filesystems an administrator mounts temporarily by hand?
    /mnt
    e.g. mount /dev/sdb1 /mnt for a quick look. Removable media go in /media.
  37. 37
    Which directory holds self-contained third-party add-on software, one subdirectory per package?
    /opt
    e.g. /opt/google/chrome. Software you build yourself goes in /usr/local instead.
  38. 38
    Which virtual filesystem shows kernel and process information, with a numbered directory per PID?
    /proc
    Nothing in it is on disk: /proc/cpuinfo is generated when you read it.
  39. 39
    Which directory is for temporary files that may be deleted at reboot?
    /tmp
    World-writable with the sticky bit, so users can delete only their own files. Contrast /var/tmp.
  40. 40
    Which top-level directory holds the bulk of installed, read-only software: programs, libraries and documentation?
    /usr
    It has its own bin, sbin, lib, share and local.
  41. 41
    Which top-level directory holds data that changes as the system runs, such as logs, spools and caches?
    /var
    var = variable data, not variables.
  42. 42
    Which directory holds the system’s log files?
    /var/log
    e.g. syslog or messages, auth.log or secure. The systemd journal is read with journalctl.
  43. 43
    Which file lists every user account with its UID, home directory and login shell?
    /etc/passwd
    World-readable. An x in the password field means the hash is in /etc/shadow.
  44. 44
    Which file holds the users’ password hashes?
    /etc/shadow
    Change aging with chage, passwords with passwd.
  45. 45
    Which file lists the groups with their GIDs and members?
    /etc/group
  46. 46
    Which personal file holds your aliases and functions, read by every new interactive shell?
    ~/.bashrc
    Apply changes to the current shell with source ~/.bashrc.
  47. 47
    Which file lists the filesystems to mount at boot?
    /etc/fstab
    A manual mount is lost at reboot; an /etc/fstab entry is persistent.
  48. 48
    Which file maps hostnames to IP addresses locally, without DNS?
    /etc/hosts
  49. 49
    Which file holds the system’s hostname?
    /etc/hostname
    hostnamectl set-hostname writes it.
  50. 50
    Which device discards everything written to it?
    /dev/null
    e.g. find / -name x 2> /dev/null hides the error messages.

Frequently asked questions

Do I need to know Linux already?

No. This is the place to start: it explains the directory tree itself. If you can open a terminal, you can use it.

Why is each fact asked twice?

Recognising /var/log is easier than recalling it. Asking both ways, from path to purpose and from purpose to path, makes the layout stick for real work and for exam questions.

What comes after this deck?

Linux filesystem intermediate covers /usr, /var and /etc in more depth, and the advanced deck covers boot, systemd, logging and library files. The Linux command line deck drills the commands themselves.

Intermediate

Linux command line

Linux commands and files for sysadmins and LPIC-1 candidates: find and grep, permissions and special bits, fstab, systemd targets, package managers, users, cron and more.

50 cards
Intermediate

Intermediate Linux filesystem

Linux paths admins use daily: /usr/local, /var/lib, /run, /sys, /etc/skel, sudoers, Bash startup files, SSH keys, resolv.conf and /proc. Free flashcards.

50 cards
Advanced

Advanced Linux filesystem

Deeper Linux files for LPIC-1: profile.d, sudoers.d, systemd units, GRUB config, nsswitch.conf, ld.so.conf, distro logs and /lib/modules. Free flashcards.

50 cards
Beginner

Bash scripting

Bash scripting flashcards: shebangs, quoting, exit codes, tests, loops, functions, arrays, parameter expansion, redirection, set -euo pipefail and traps.

50 cards
Beginner

Vim

Learn Vim from the keyboard up: modes, motions, operators and text objects, search and :s substitutions, registers, macros, visual mode and windows.

50 cards
Beginner

Networking

Computer networking fundamentals: OSI and TCP/IP layers, TCP vs UDP, common port numbers, subnetting and CIDR, DNS, DHCP and ARP, and IPv6 basics.

50 cards
Beginner

Cyber security

Cyber security flashcards: the CIA triad, phishing, XSS, CSRF, SQL injection, MITM, hashing vs encryption, TLS, MFA, least privilege, OWASP and zero trust.

50 cards
Beginner

Docker

Learn Docker from images and layers to multi-stage builds, volumes, networks and Compose, with the commands and best practices you use daily.

50 cards
Intermediate

Kubernetes

Kubernetes fundamentals for developers and CKA or CKAD candidates: Pods, Deployments, Services, storage, probes, resources and scheduling, plus the kubectl commands you use daily.

50 cards
Beginner

AWS

AWS flashcards: regions and AZs, EC2, S3 storage classes, IAM users, roles and policies, VPC networking, RDS, Lambda, CloudWatch and Route 53.

50 cards
Beginner

Terraform

Terraform flashcards: HCL, providers, resources, variables and outputs, state and remote backends, plan and apply, modules, count, for_each, drift and import.

50 cards