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.
Practice now
Study without an account
/ for?Scheduled with the default Askesis timings. Progress is saved in this browser.
All 50 cards
- 1What 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. - 2What is
/binfor?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). - 3What is
/sbinfor?Essential system administration commands (fsck,mkfs,reboot).Mostly for root. A symlink to/usr/sbinon merged systems. - 4What is
/bootfor?What’s needed to boot: the kernel (vmlinuz), the initramfs and the GRUB bootloader files.Often a small separate partition. - 5What is
/devfor?Device files: the interface to hardware and pseudo-devices (/dev/sda,/dev/null).Created dynamically by the kernel and udev as devices appear. - 6What is
/etcfor?System-wide configuration files, in plain text.Host-specific and static: configuration only, no programs./etc/passwd,/etc/fstab,/etc/hosts… - 7What is
/homefor?The home directories of regular users, e.g./home/alice.Often a separate partition or network share, so users’ data survives a reinstall. - 8What is
/rootfor?The home directory of the root user.Kept on the root filesystem, so it’s there even when/homeisn’t mounted. - 9What is
/libfor?The essential shared libraries for the commands in/binand/sbin, and the kernel modules (/lib/modules)./lib64holds the 64-bit libraries on some distributions. A symlink to/usr/libon merged systems. - 10What is
/mediafor?Mount points for removable media such as USB sticks and DVDs, usually created automatically.e.g./media/alice/USBSTICK. Contrast/mnt, for manual mounts. - 11What is
/mntfor?A place for temporary filesystems the administrator mounts by hand.e.g.mount /dev/sdb1 /mntfor a quick look. Removable media go in/media. - 12What is
/optfor?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/localinstead. - 13What is
/procfor?A virtual filesystem with kernel and process information: one numbered directory per running process.Nothing in it is on disk:/proc/cpuinfois generated when you read it. - 14What is
/tmpfor?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. - 15What is
/usrfor?The second hierarchy: the bulk of installed, read-only software (programs, libraries, documentation).It has its ownbin,sbin,lib,shareandlocal. - 16What is
/varfor?Variable data that changes while the system runs: logs, spools, caches, databases.var = variable data, not variables. - 17What is
/var/logfor?The log files of the system and its services.e.g.syslogormessages,auth.logorsecure. The systemd journal is read withjournalctl. - 18What is
/etc/passwd?One line per user account: name, password placeholder, UID, GID, comment, home directory, login shell.World-readable. Anxin the password field means the hash is in/etc/shadow. - 19What is
/etc/shadow?The users’ password hashes and password-aging data, readable only by root.Change aging withchage, passwords withpasswd. - 20What is
/etc/group?The groups: group name, GID and the list of members. - 21What is
~/.bashrc?Your personal startup file for every interactive shell: aliases, functions, prompt.Apply changes to the current shell withsource ~/.bashrc. - 22What is
/etc/fstab?The filesystems to mount at boot: device, mount point, type, options, dump and fsck order.A manualmountis lost at reboot; an/etc/fstabentry is persistent. - 23What is
/etc/hosts?Static hostname-to-IP mappings, checked before DNS by default. - 24What is
/etc/hostname?The system’s hostname.hostnamectl set-hostnamewrites it. - 25What is
/dev/null?The bit bucket: discards everything written to it; reading it gives end-of-file.e.g.find / -name x 2> /dev/nullhides the error messages. - 26Which directory is the top of the whole tree, where every absolute path starts?
/Not to be confused with/root, the root user’s home. - 27Which top-level directory holds the essential commands every user needs, such as
lsandcp?/binOn current distributions it’s a symlink to/usr/bin(the usr merge). - 28Which top-level directory holds the essential system administration commands, such as
fsckandmkfs?/sbinMostly for root. A symlink to/usr/sbinon merged systems. - 29Which directory holds the kernel image, the initramfs and the bootloader files?
/bootOften a small separate partition. - 30Which directory holds the device files, such as
/dev/sdaand/dev/null?/devCreated dynamically by the kernel and udev as devices appear. - 31Which directory holds the system-wide configuration files?
/etcHost-specific and static: configuration only, no programs./etc/passwd,/etc/fstab,/etc/hosts… - 32Which directory holds the regular users’ home directories?
/homeOften a separate partition or network share, so users’ data survives a reinstall. - 33Which directory is the root user’s home?
/rootKept on the root filesystem, so it’s there even when/homeisn’t mounted. - 34Which top-level directory holds the essential shared libraries and the kernel modules?
/lib/lib64holds the 64-bit libraries on some distributions. A symlink to/usr/libon merged systems. - 35Under which directory are removable media such as USB sticks mounted automatically?
/mediae.g./media/alice/USBSTICK. Contrast/mnt, for manual mounts. - 36Which directory is meant for filesystems an administrator mounts temporarily by hand?
/mnte.g.mount /dev/sdb1 /mntfor a quick look. Removable media go in/media. - 37Which directory holds self-contained third-party add-on software, one subdirectory per package?
/opte.g./opt/google/chrome. Software you build yourself goes in/usr/localinstead. - 38Which virtual filesystem shows kernel and process information, with a numbered directory per PID?
/procNothing in it is on disk:/proc/cpuinfois generated when you read it. - 39Which directory is for temporary files that may be deleted at reboot?
/tmpWorld-writable with the sticky bit, so users can delete only their own files. Contrast/var/tmp. - 40Which top-level directory holds the bulk of installed, read-only software: programs, libraries and documentation?
/usrIt has its ownbin,sbin,lib,shareandlocal. - 41Which top-level directory holds data that changes as the system runs, such as logs, spools and caches?
/varvar = variable data, not variables. - 42Which directory holds the system’s log files?
/var/loge.g.syslogormessages,auth.logorsecure. The systemd journal is read withjournalctl. - 43Which file lists every user account with its UID, home directory and login shell?
/etc/passwdWorld-readable. Anxin the password field means the hash is in/etc/shadow. - 44Which file holds the users’ password hashes?
/etc/shadowChange aging withchage, passwords withpasswd. - 45Which file lists the groups with their GIDs and members?
/etc/group - 46Which personal file holds your aliases and functions, read by every new interactive shell?
~/.bashrcApply changes to the current shell withsource ~/.bashrc. - 47Which file lists the filesystems to mount at boot?
/etc/fstabA manualmountis lost at reboot; an/etc/fstabentry is persistent. - 48Which file maps hostnames to IP addresses locally, without DNS?
/etc/hosts - 49Which file holds the system’s hostname?
/etc/hostnamehostnamectl set-hostnamewrites it. - 50Which device discards everything written to it?
/dev/nulle.g.find / -name x 2> /dev/nullhides 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.
More in IT & DevOps
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 cardsIntermediate 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 cardsAdvanced 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 cardsBash scripting
Bash scripting flashcards: shebangs, quoting, exit codes, tests, loops, functions, arrays, parameter expansion, redirection, set -euo pipefail and traps.
50 cardsVim
Learn Vim from the keyboard up: modes, motions, operators and text objects, search and :s substitutions, registers, macros, visual mode and windows.
50 cardsNetworking
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 cardsCyber 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 cardsDocker
Learn Docker from images and layers to multi-stage builds, volumes, networks and Compose, with the commands and best practices you use daily.
50 cardsKubernetes
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 cardsAWS
AWS flashcards: regions and AZs, EC2, S3 storage classes, IAM users, roles and policies, VPC networking, RDS, Lambda, CloudWatch and Route 53.
50 cardsTerraform
Terraform flashcards: HCL, providers, resources, variables and outputs, state and remote backends, plan and apply, modules, count, for_each, drift and import.
50 cards