Linux commands to check free disk space in console / terminal

Banko StoyanovJanuary 29, 20245min0
home-folder.png

With the help of this useful set of commands, monitor disk consumption.

One of the everyday tasks for system administrators (and others) is to monitor disk utilization information. A few built-in tools in Linux assist in providing that information.

The df command in Linux

The Linux program df, which stands for “disk-free,” displays the amount of disk space that is both occupied and available.

Disk space is shown in readable format with df -h.

Even when the Available field is zero, df -a displays the whole disk use of the file system.

df command

 

The disk utilization and the kind of filesystem (xfs, ext2, ext3, btrfs, etc.) for each block are displayed by the command df -T.

df -i displays free and utilized inodes.

df -T

GNOME desktop users may obtain this data in a graphical style by utilizing the Disks (gnome-disk-utility) application. Launch it to view every disk that your computer has identified. Click on a partition to get more information about it, including the amount of space it has consumed and left.

Disks

 

The du command in Linux

du displays the default kilobyte size of files, directories, etc.’s disk use.

du -h displays disk use for all folders and subdirectories in a manner that is understandable by humans.

All file disk utilization is seen using du -a.

The total disk space consumed by a specific file or directory is provided by du -s.

du -h

You may check your total and used space with the following commands.

Filelight in the KDE Plasma desktop or the Disk Usage tool in GNOME may both graphically depict this data. Disk consumption is represented by concentric rings in both apps. The base folder, which is often your /home directory, is in the center, and each outer ring represents a directory level below that. You may get comprehensive details about what’s taking up space by rolling your cursor over any part.

HomeHome Folder

Command ls -al in Linux

ls -al lists every item in a given directory, along with how big they are.

ls-al

stat command in Linux

stat <file/directory> shows a filesystem’s or file/directory’s size and other statistics.

stat

The fdisk -l command in Linux

Disk size and disk partitioning details are displayed with fdisk -l.

fdisk -l

These comprise the majority of the pre-installed Linux programs for verifying file size. Numerous comparable utilities, such as Ncdu, Disks (GUI), etc., may similarly display disk space use. What is your go-to tool that’s not on this list? Kindly let us know in the comments.

Banko Stoyanov

This blogpost is written by Banko Stoyanov. Stoyanov is a Marketing manager at CooliceHost. Stoyanov holds an MBA in Marketing strategy and Business developing. He's passionate about data analysis, consumer behavior, cloud technology, and marketing. He is a lifelong learner who regularly keeps himself updated with the latest technologies and industry advancements. In his free time, he explores coffee scene and stays active through running and fitness. Find him on Linkedin and Facebook.


Leave a Reply

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


Copyright © 2024 – CooliceHost.com – All Rights Reserved.