Paths and navigation

The Unix filesystem is a tree rooted at /. Navigation is a combination of path awareness and safe movement.

Absolute vs relative

  • Absolute: Starts at / (example: /var/log).
  • Relative: Starts from your current directory (example: ../logs).
  • Use pwd often to confirm context.
  • Prefer absolute paths in scripts.
  • Avoid cd chains in production scripts; use explicit paths.