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.
Topic: Security Tools, Authorized Labs & CTFs in Cybersecurity & Ethical Hacking · Explainer
Also covers: Linux Administration
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?
- Where do configuration, state and project work belong?
- Why are /proc and /sys different from report folders?
- How should you interpret /usr and symbolic-link paths?
- Can you practise the layout without touching system paths?
- How do you use the hierarchy during a real support task?
- References
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 category | Illustrative location | Question before maintenance |
|---|---|---|
| Host configuration | /etc/demo/settings.conf | Which local settings must be preserved? |
| Persistent state | /var/lib/demo/index.txt | How is application state backed up consistently? |
| Activity record | /var/log/demo/events.log | Where are logs actually collected and retained? |
| Student work | /home/student/project/notes.txt | Who may read and retain the project? |
| Runtime or temporary data | /run or /tmp | Can 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 sortExpected 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 observation | Question to resolve |
|---|---|
| Relative path works in one shell only | Are the working directories the same? |
| Package support file appears missing | What does the installed package record supply? |
| Configured state location is unavailable | Is the intended mount and path present? |
| Path exists but access is denied | Which 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
What's Your Reaction?
Like
1
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0