Kali Linux File System Hierarchy: Find the Right Kind of Data

Kali’s file system is a directory tree rooted at /, with different locations for configuration, installed software, changing service data and personal work. Use those purposes to decide where to look and what must be preserved. /root is a user’s home directory, while / is the tree’s root. Some familiar paths may be symbolic links, and /proc and /sys expose kernel interfaces rather than ordinary saved documents.

Jan 17, 2025 - 15:06
Updated: 
104.7k

Security Tools, Authorized Labs & CTFs in Cybersecurity & Ethical Hacking · Explainer

Linux Administration

Kali Linux File System Hierarchy: Find the Right Kind of Data

Quick answer: Kali’s file system is a directory tree rooted at /, with different locations for configuration, installed software, changing service data and personal work. Use those purposes to decide where to look and what must be preserved. /root is a user’s home directory, while / is the tree’s root. Some familiar paths may be symbolic links, and /proc and /sys expose kernel interfaces rather than ordinary saved documents. Check the actual installation and package records before assuming that an example path or log file exists.

Key takeaways

  • Classify a path by purpose and lifetime before changing it.
  • Separate personal project work from package-managed files.
  • Inspect symbolic links and mounts when a path looks unexpected.
  • Treat kernel interfaces as live system state.
  • Keep important work out of temporary storage.

Table of Contents

How do absolute and relative paths describe the tree?

The Linux hierarchy manual describes common Linux directories. An absolute pathname begins at /; a relative pathname begins from the process’s current directory. The path_resolution manual explains that lookup walks directory components and requires search permission. A correct filename can still be inaccessible because a parent directory cannot be traversed.

Imagine a student receives the relative name project/notes.txt. Before deciding it is missing, she needs to know the current directory. The same relative text can identify different files in two shells. By contrast, /home/student/project/notes.txt names a location from the visible root. Containers, separate mount namespaces and local configuration can give processes different views, so record the environment along with a path.

Where do configuration, state and project work belong?

The UAPI hierarchy specification distinguishes locations by their purpose, including configuration, variable state and runtime data. /etc commonly holds host-specific configuration. /var/lib commonly holds persistent service state, while /var/log is associated with logs. A log may also be available through a journal or another configured destination; a directory convention does not guarantee one particular text file exists.

For an invented indexing service, settings.conf describes how it should operate, index.txt represents changing durable state and events.log records activity. A student’s explanation belongs in her own project directory. Keeping these separate makes a backup or maintenance discussion more precise: replacing software, preserving service state and retaining project notes are different requirements.

Example categoryIllustrative locationQuestion before maintenance
Host configuration/etc/demo/settings.confWhich local settings must be preserved?
Persistent state/var/lib/demo/index.txtHow is application state backed up consistently?
Activity record/var/log/demo/events.logWhere are logs actually collected and retained?
Student work/home/student/project/notes.txtWho may read and retain the project?
Runtime or temporary data/run or /tmpCan this data disappear without harming the task?

Why are /proc and /sys different from report folders?

The proc manual describes a pseudo-filesystem exposing process and kernel information. Many entries are generated views, and some writable entries can change kernel settings. Their apparent file form does not mean they are ordinary documents that should be edited, copied back or cleaned up like a draft report.

The Linux sysfs interface exposes kernel objects, devices and related information. Symbolic links connect parts of that view, and some attributes are writable interfaces. Start by reading the relevant documentation and the approved task. A learner exploring directory names should not write to either tree. In a support note, identify the specific interface and observation instead of saying that an arbitrary system file was repaired.

How should you interpret /usr and symbolic-link paths?

Installed commands, libraries and shared application data commonly live under /usr. Modern layouts may merge traditional top-level command and library directories into /usr through symbolic links. Inspect the actual installation before claiming every directory is separate or every image has an identical arrangement. A manual’s historical description can coexist with a current link-based layout.

Use the dpkg-query command to understand how Debian package records describe installed files. A tool’s supporting data is not a safe location for your own irreplaceable edits simply because you found it under /usr/share. Package updates can replace managed content. Keep local projects separately and document any approved override mechanism instead of adding ad hoc files to a command directory.

Can you practise the layout without touching system paths?

Yes. This checked shell fixture creates a fresh temporary directory and four invented files beneath it. The names imitate hierarchy categories, but no real /etc, /var or user home is changed. The relative paths in the output make that boundary visible. It ran in the existing BusyBox Linux /bin/sh environment, not as a full Kali validation.

set -eu
lab=$(mktemp -d /tmp/webasha-paths.XXXXXX)
cd "$lab"
mkdir -p etc/demo var/lib/demo var/log/demo home/student/project
printf '%s\n' 'invented configuration' > etc/demo/settings.conf
printf '%s\n' 'invented durable state' > var/lib/demo/index.txt
printf '%s\n' 'invented event' > var/log/demo/events.log
printf '%s\n' 'invented project note' > home/student/project/notes.txt
find . -type f | LC_ALL=C sort

Expected output:

./etc/demo/settings.conf
./home/student/project/notes.txt
./var/lib/demo/index.txt
./var/log/demo/events.log

Read each line as an exercise location, not as evidence about this computer’s installed services. Explain which file you would preserve for configuration, which represents durable state and which is a personal note. The exercise checks directory creation and a file listing; it does not test a backup, retention policy or application recovery.

How do you use the hierarchy during a real support task?

Supplied support observationQuestion to resolve
Relative path works in one shell onlyAre the working directories the same?
Package support file appears missingWhat does the installed package record supply?
Configured state location is unavailableIs the intended mount and path present?
Path exists but access is deniedWhich account and parent permissions apply?

Suppose a service stops finding its index after a software update. First identify the service’s documented state location, configuration and package version. Do not assume the index belonged under /usr/share because an old tutorial put sample data there. Compare the actual configured path with the package and service documentation, then ask the owner how its state is restored.

Record mounts and links that affect the path, the account performing the operation and the relevant error. Avoid broad recursive ownership or permission changes while still discovering the layout. A useful handover distinguishes missing software, unavailable state and inaccessible directories. Those explanations lead to different approved actions and help the next administrator investigate without guessing which files can be discarded.

Related reading: directory and file permission decisions; package state and ownership; selecting a manual page.

If you want instructor feedback, ask WebAsha for a syllabus, supervised lab arrangements and written access terms before enrolling.

References

Frequently Asked Questions

No; / begins the visible directory tree, while /root is conventionally the home directory of the root account.

No; installed services, logging configuration and collection mechanisms determine which files or journal records are actually available.

Temporary storage can be cleaned according to local policy, so keep required project work in an approved persistent location.

Many entries expose generated kernel or process information, and writable interfaces can change live settings rather than edit a document.

Modern layouts can merge traditional locations into /usr, so inspect the actual path instead of assuming separate physical directories.

Use the documented local configuration or override mechanism, because package-managed files can be replaced and need a clear maintenance owner.

No; it created invented relative paths inside a fresh temporary directory and performed no system configuration or package changes.

No; backup coverage, consistency, access and restoration require separate checks for the actual application and its configured state.

What's Your Reaction?

Like Like 1
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.