recently switched from a Windows server to a Linux server operating system and need Linux check disk space command. I am using Ubuntu 16.04/18.04/20.04 and CentOS 7.x/8.x server. How do I find out disk space utilization information using Linux command line option?

Linux offer the following commands to check disk space usage:

ADVERTISEMENTS

Linux commands to check disk space using:

  1. df command – Shows the amount of disk space used and available on Linux file systems.
  2. du command – Display the amount of disk space used by the specified files and for each subdirectory.
  3. btrfs fi df /device/ – Show disk space usage information for a btrfs based mount point/file system.

Linux check disk space with df command

  1. Open the terminal and type the following command to check disk space.
  2. The basic syntax for df is:
  3. df [options] [devices]
  4. Type:
  5. df
  6. df -H

Sample outputs:

Fig.01: Linux check disk space with df commandFig.01: df command in action

The items in square brackets are optional. You can simply type the df command (i.e. no arguments), to see a table that lists for each device name on the system.See information about specific filesystem

You can give a device or mount point as an argument, and df report data only for the filesystem physically residing on that device. For example, the following command provides information only for the partition /dev/sda:

$ df /dev/sda

$ df -h /dev/sdc1

$ df /data/

Sample outputs:

Filesystem      1K-blocks     Used  Available Use% Mounted on
/dev/sda       2930266584 69405248 2859579472   3% /data

#linux

Linux Check Disk Space Command To View Disk Usage
1.30 GEEK