| |

CLI:Basics Disk Utilities – Checking Disk Space, Partitions, and Devices

In this part of the CLI:Basics series, we’re diving into disk utilities — essential tools to view disk space, partitions, and devices.

Today’s goal is to keep it simple and practical, setting you up to expand into deeper disk management later in CLI:Advanced.

Let’s jump in:


🧮 Checking Disk Space with df

  • Basic usage: df
  • Human-readable format (recommended): df -h
  • Filter out unnecessary entries (e.g., temporary file systems): df -h | grep -v tmpfs
  • Tip:
    df shows how much space is used, how much is available, and which partitions are mounted where.

📂 Checking Directory Sizes with du

  • Basic directory size usage: du
  • Human-readable summary for current directory: du -sh
  • Check a specific folder (example: Text folder): du -sh Text/

⚙️ Viewing Partition Info with fdisk

  • List all partitions (requires sudo): sudo fdisk -l
  • Useful for:
    • Checking drive models
    • Viewing partition layouts
    • Identifying unformatted drives

Warning:
fdisk can destroy data if used incorrectly. Only use -l for safe listing unless you know what you’re doing.


🔎 Viewing Device Tree with lsblk

  • Display all block devices and their mount points: bashCopyEditlsblk
  • Shows:
    • Which drives are mounted
    • Partition structure
    • Available storage devices not yet mounted

Final Thoughts

Today’s video covered safe, basic ways to view your Linux system’s disk usage, partition layout, and available devices.

Linux puts the power in your hands — even when managing disks.
Understanding tools like df, du, fdisk, and lsblk is the first step toward full control.

We’ll go deeper into advanced disk management (like partition expansion and formatting) in the upcoming CLI:Advanced series!

👉 Make sure to like, subscribe, and hit the notification bell so you don’t miss the next step in your Linux journey.

Similar Posts

Leave a Reply