Linux check disk space

In this tutorial, How do I check disk space on Linux distribution? Sometimes you find out which directory consumes how much disk space. I used the du command and the df command. Linux the essential for DevOps Roles.

To check the disk space on a Linux system, you can use the df command. Here’s how you can do it:

  • Investigate the folder for Disk Usage
  • Checking Disk Space

Linux check disk space

Investigate the folder for Disk Usage

du command summarizes disk usage and recursively for files and directories

The syntax,

du [option]

For example, Summarizing disk usage in the current directory

[huupv@huupv devopsroles]$ du -sh *

The summarizing includes hidden files

[huupv@huupv devopsroles]$ du -sh .[!.]* *

you can add total the output by adding the -c option

[huupv@huupv devopsroles]$ du -csh .[!.]* *

The screen output terminal:

Linux check disk space

Investigate root director will only show folders with more than 20GB for disk usage

[huupv@huupv devopsroles]$ sudo du --threshold=20G -ch /.[!.]* /*

Checking Disk Space

[huupv@huupv devopsroles]$ df -h


Thought the article, you can use Linux check disk space as above. I hope will this your helpful. Thank you for reading the DevopsRoles page!

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.