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
Linux check 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:
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. Thank you for reading the DevopsRoles page!