Linux check disk space

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

  • Investigate folder for Disk Usage
  • Checking Disk Space

Investigate folder for Disk Usage

du command summarizes disk usage and recursively for files and directories

The syntax,

du [option]

For example, Summarizing disk usages in the current directory

[huupv@huupv devopsroles]$ du -sh *

The summarizing include hidden files

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

you can add total the output by adding -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

Conclusion

Thought the article, you can use Linux check disk space as above. I hope will this your helpful.

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 DevopsRoles.com 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 *

Comment moderation is enabled. Your comment may take some time to appear.

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