Linux directory structure

In Linux, all files and directories live under the single root directory /.

  • /etc — system and service configuration files.
  • /home — personal directories of regular users.
  • /var — logs, queues and changing application data.
  • /usr — programs, libraries and shared resources.
  • /tmp — temporary files.
  • /root — the root user's home directory.

Practical commands

pwd
ls -lah /
ls -lah /etc
du -sh /var/log

pwd prints the current directory, ls -lah includes hidden files, and du -sh summarizes directory size.

Practice

Inspect /etc, /home and /var/log, then describe what each directory is used for.