If you use Linux, it’s very helpful to know where important system files are stored. These folders control how your system runs, manages users, handles logs, and much more.
Here’s a quick and easy guide to the 10 most useful Linux directories and what they do 👇
1. /etc/passwd & /etc/shadow
These two files store user account details.
/etc/passwdhas info like username, user ID, and home folder./etc/shadowstores encrypted passwords and password expiry settings.
👉 Only the root user can view or edit/etc/shadow.
2. /etc/sudoers
This file controls who can run commands as root using sudo.
To edit it safely, always use: visudo
3. /etc/hosts & /etc/resolv.conf
These handle your computer’s network name settings.
/etc/hostsmaps IPs to names (like a mini local DNS)./etc/resolv.conftells your system which DNS servers to use.
127.0.0.1 localhost
8.8.8.8 google.com
4. /etc/fstab
This file lists all the disks and partitions your system mounts automatically when it starts.
Example:
/dev/sda1 / ext4 defaults 0 1
5. /var/log/
This folder contains system logs — records of what’s happening inside your system.
Common logs:
syslog→ general system messagesauth.log→ login and authentication logsdmesg→ kernel messages
You can check logs using:
tail -f /var/log/syslog
6. /etc/network/interfaces or /etc/netplan/*.yaml
These files manage your network connections.
Older systems use /etc/network/interfaces, while newer ones (like Ubuntu 20+) use /etc/netplan/.
Example (Netplan):
network:
version: 2
ethernets:
eth0:
dhcp4: true
7. ~/.bashrc & ~/.bash_profile
These files store your custom commands and environment settings.
For example, you can set shortcuts (aliases) or add paths:
alias ll='ls -la'
export PATH=$PATH:/opt/bin
8. /etc/crontab & /var/spool/cron/
These files are used to schedule automatic tasks (cron jobs).
Example:
0 3 * * * /usr/bin/backup.sh
9. /var/www/
This is where web server files are stored — like your website’s pages and scripts.
Example:
/var/www/html/index.html
10. /etc/systemd/system/
This folder controls system services — programs that start automatically (like web servers or databases).
You can manage them using:
systemctl start nginx
systemctl enable mysql
systemctl status ssh