Filesystem Hierarchy Standard (FHS)
Cheat sheet · https://pcornel.dk/topic.php?topic=2659
Answer
The Filesystem Hierarchy Standard (FHS) defines where things belong: /etc configuration, /var variable data and logs, /usr installed software, /home user data, /tmp temporary files, /opt add-on software, /boot kernel and bootloader files.
Remember
Put configuration in /etc, data in /var or /srv, local software in /usr/local or /opt — never edit files under /usr that packages own, they are overwritten on update. Many distributions merge /bin into /usr/bin.
First checks
dpkg -S <path>— which Debian package owns a filerpm -qf <path>— which RPM owns a filels -ld <path>— owner, permissions and typestat <path>— inode, links, size and timestampsdf -h <path>— filesystem and free spacefindmnt <path>— which mount the path is on
Verify in this order
file type (config, data, log, program) → FHS directory → package or admin ownership
Where it usually breaks
First mismatch in hardware/block device → kernel driver/mapper/RAID/LVM → filesystem → mount namespace/options → path permissions/MAC → consumer I/O; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2659