Modern QA2026Directories You Will Use Most
Log inJoin
1 / 2 · Book 19 · The Linux Directory Structure · drill: interview Q&A⊞ allnext →Get the book →

1.2Directories You Will Use Most

/home/user/ -- Your Home Directory (~)

This is where you work. Your scripts, test configurations, SSH keys, and shell customizations live here. The tilde (~) is a shortcut for your home directory path.

# Navigate to home directory
cd ~
# Or simply:
cd

# Common QA files in home directory
~/.ssh/config          # SSH connection shortcuts
~/.bashrc              # Shell customization (aliases, PATH)
~/.npmrc               # npm configuration
~/.env                 # Personal environment variables (not committed)
~/projects/            # Your cloned repositories

Your .bashrc (or .zshrc on macOS) is one of the most important files here. It runs every time you open a new terminal. This is where you put aliases, custom PATH entries, and shell functions that make your daily work faster.

/var/log/ -- Logs

This is where you investigate failures. Application logs, system logs, and web server logs all live here. When a test fails at 2 AM and you need to figure out what happened, this directory is your first stop.

# Common log locations
/var/log/syslog                    # System messages
/var/log/auth.log                  # Authentication events
/var/log/nginx/access.log          # Nginx access logs
/var/log/nginx/error.log           # Nginx error logs
/var/log/app/application.log       # Application-specific logs
/var/log/postgresql/postgresql.log  # Database logs

Pro Tip: Log files can grow enormous. Never open a multi-gigabyte log file in a text editor. Use tail, grep, less, and awk to extract only the lines you need.

/etc/ -- Configuration

Configuration files for system services and applications. When tests fail due to misconfiguration, this is where you look.

# Common configuration files
/etc/hosts                # DNS overrides (useful for test environments)
/etc/nginx/nginx.conf     # Nginx web server config
/etc/environment          # System-wide environment variables
/etc/postgresql/pg_hba.conf  # PostgreSQL access control
/etc/ssl/certs/           # SSL certificates

Common Mistake: Editing files in /etc/ usually requires sudo (administrator) privileges. If you get "Permission denied" when trying to edit a config file here, prepend sudo to your command. But be careful -- changes in /etc/ affect the entire system.

/tmp/ -- Temporary Files

Temporary data that is cleared on reboot. Useful for staging test data or storing intermediate results during test runs.

# Use /tmp for temporary test data
cp test-data.json /tmp/
# Run tests that use /tmp/test-data.json
# On reboot, the file is automatically cleaned up

/proc/ -- Virtual Filesystem

Not real files -- this is a window into the kernel and running processes. Useful for debugging performance issues and inspecting running processes.

# Check system memory
cat /proc/meminfo | head -5

# Check CPU information
cat /proc/cpuinfo | grep "model name" | head -1

# Check a specific process (replace 1234 with actual PID)
cat /proc/1234/status | grep -E "(Name|State|VmRSS)"