Home >Computer Tutorials >Computer Knowledge >Query the disk space usage of CentOS system

Query the disk space usage of CentOS system

王林
王林forward
2024-02-20 08:09:111367browse

CentOS 系统的磁盘空间占用情况查询

Command introduction

  1. Use the df -h command to view the total capacity and used capacity of each file system. Your output shows that /dev/mapper/centos-root takes up 47% of the space, which is 36G.

  2. Use the du -h -x –max-depth=1 / command to view the size of each subdirectory under the root directory. You can find out the directories that take up a lot of space based on the output, such as /var, /home, /usr, etc.

  3. You can check the size of each subdirectory under the /var directory by running the command du -h -x --max-depth=1 /var. Continue this process until you find a file or directory that takes up more space.

Article recommendation

https://blog.csdn.net/sch_wzq/article/details/105988036

The above is the detailed content of Query the disk space usage of CentOS system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:mryunwei.com. If there is any infringement, please contact admin@php.cn delete