How to display disk usage in Linux?

To display disk usage on a Linux system, you can use the following command:

  1. DF command: Displays disk space usage of mounted file systems.
df -h

This command will display the disk usage of mounted file systems, including total capacity, used capacity, and available capacity.

  1. du command: Display the disk usage of a specified directory or file.
du -sh /path/to/directory

This command will display the disk usage of the specified directory or file, including the total size.

  1. lsblk command: displays detailed information about disks and partitions.
lsblk

This command will display detailed information about all disks and partitions on the system, including disk size, partition size, and file system type.

  1. fdisk command: display detailed information about disk partition table.
fdisk -l

This command will display detailed information of the partition tables for all disks on the system, including partition type, starting sector, and partition size.

This command can be executed in the terminal to display the corresponding disk usage.

bannerAds