How to Check Disk Space in Linux: df, du and Cleanup Commands

How to Check Disk Space in Linux: df, du and Cleanup Commands

A practical guide to checking Linux disk usage, finding large files and safely cleaning common server locations.

A practical guide to checking Linux disk usage, finding large files and safely cleaning common server locations. This guide is written for IT support engineers, system administrators, help desk staff and learners who want practical Linux server skills.

What you will learn

  • Check filesystem usage with df
  • Find large folders with du
  • Inspect logs and journals
  • Safe cleanup checklist
  • When to expand storage

Check filesystem usage with df

Check filesystem usage with df is an important part of Linux server administration. Start with read-only checks, understand what the output means, then apply the smallest safe fix. This keeps systems stable and reduces troubleshooting time.

Find large folders with du

Find large folders with du is an important part of Linux server administration. Start with read-only checks, understand what the output means, then apply the smallest safe fix. This keeps systems stable and reduces troubleshooting time.

Inspect logs and journals

Inspect logs and journals is an important part of Linux server administration. Start with read-only checks, understand what the output means, then apply the smallest safe fix. This keeps systems stable and reduces troubleshooting time.

Safe cleanup checklist

Safe cleanup checklist is an important part of Linux server administration. Start with read-only checks, understand what the output means, then apply the smallest safe fix. This keeps systems stable and reduces troubleshooting time.

When to expand storage

When to expand storage is an important part of Linux server administration. Start with read-only checks, understand what the output means, then apply the smallest safe fix. This keeps systems stable and reduces troubleshooting time.

Useful commands

Run commands carefully and test on a lab machine before using them on production servers.

  • df -h
  • du -sh /var/log/*
  • sudo journalctl --disk-usage
  • sudo apt clean
  • find /var/log -type f -name "*.gz" -size +100M

Practical troubleshooting workflow

  1. Confirm the exact symptom and error message.
  2. Check the service, file, user or network state with read-only commands first.
  3. Make one small change at a time and record what changed.
  4. Verify the result from the user or application point of view.
  5. Document the fix so the same issue is easier next time.

Common mistakes to avoid

  • Do not copy commands blindly from the internet into a production server.
  • Do not use broad permissions or root access when a smaller change is enough.
  • Always keep a backup or rollback plan before changing system settings.

FAQ

Is this suitable for beginners?

Yes. The examples are beginner friendly but still useful for real IT support and server administration work.

Can I use these commands on Ubuntu, Debian or CentOS?

Most commands work across common Linux distributions. Package names, log paths or service names can vary slightly.

Should I test before using these steps on production?

Yes. Always test carefully in a lab or maintenance window, especially when changing permissions, services, users, firewall rules or scheduled jobs.

Disclaimer: This tutorial is for educational purposes. Test commands carefully. WhileNetworking is not responsible for misuse, damage, data loss or production issues.

Leave a Reply

Your email address will not be published. Required fields are marked *