Home > Article > System Tutorial > How to master disk usage in Ubuntu system
We want to check the hard disk usage in the system. How to check it in Ubuntu system? Let's take a look at the tutorial on checking the hard disk usage in Ubuntu system.
1. On the system, click on the lower left corner of the desktop, as shown in the picture.
2. In the system, click Utilities, as shown in the picture.
3. Click Disk Usage, as shown in the picture.
4. Then you can see the disk usage, that is, the disk in the middle is your computer’s hard disk, as shown in the picture. The small print below the disk is the usage.
5, or click the disk on the utility, as shown.
6. Then under the capacity, you can see the hard disk usage, as shown in the picture.
The following is the text version
Check disk usage:
df -h
The results are as follows:
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 799M 4.0M 795M 1% /run
/dev/vda1 50G 35G 12G 75% /
tmpfs 3.9G 480K 3.9G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/vdb1 50G 29G 19G 62% /mnt
tmpfs 799M 0 799M 0% /run/user/0
none 50G 29G 19G 62% /mnt/docker/aufs/mnt/b90499886d3ff756daa538e07d0b901de9e53440dbaf4d217eb40625067dcb4d
shm 64M 0 64M 0% /mnt/docker/containers/bcc5c892e25b5d1afea9084e02dcea1f16d7e19b54042d60737f94f0af4e466f/shm
none 50G 29G 19G 62% /mnt/docker/aufs/mnt/043c3429c71f55538c8fafcd1109ee32d848c00550a98aee4d668847443f1d92
shm 64M 0 64M 0% /mnt/docker/containers/f72c337b0a09796c4d9efa857dea5902b01c3e2fc31af8424519883a00a41c5c/shm
none 50G 29G 19G 62% /mnt/docker/aufs/mnt/1a2451898f06be63e41d91fb3c2d15a6267158936ecaf22ab829dd8d0065c079
none 50G 29G 19G 62% /mnt/docker/aufs/mnt/4ea840ebad40c0fc980e32a57523d99dbf5dd785757e104578a1cd278a547586
shm 64M 0 64M 0% /mnt/docker/containers/ba712b6fafb07e74de4277a7d9e27c4e158dd5e9b578156537ba491e7706536b/shm
none 50G 29G 19G 62% /mnt/docker/aufs/mnt/52582751008b11d65bd37e9e2a2b5b192fc43f0cd03ee6f6720b148ec88fe8a3
shm 64M 0 64M 0% /mnt/docker/containers/83e024ee7d5c0804913f92df9b066c1666f7ecf8b3337520775c74455ba25d07/shm
shm 64M 0 64M 0% /mnt/docker/containers/c4f08555ce13120570cca0e6954b992d0059444a9b503e0ee6eda84f894a8dee/shm
none 50G 29G 19G 62% /mnt/docker/aufs/mnt/7daf0acc60832e43ae1a474d39fb5fcaca44d594d551e0a22142e817b9670630
shm 64M 0 64M 0% /mnt/docker/containers/d420cdad38ea325a06eba3e5ad26d5687be12d8ecf4bab3db5dbe3e72a512216/shm
The usage rate of my previous /dev/vdb1 reached 100%, which caused MongoDB to no longer be able to write files and enter the fail state.
Let’s start from the root directory /, check the files or folders that take up a lot of space step by step, and clean up the unused files
Enter / directory:
cd /
View the size of each file and folder
du -sh *
The results are as follows:
28K a.txt
28K a.txt.save
13M bin
96M boot
4.0K deploy.py
12Kdev
12K docker
Then I usually search for files starting with the largest ones and see if the files can be deleted, over
To delete the command, you must include the folder name, otherwise it will be deleted for you
rm -rf {file or folder name}
The above is the detailed content of How to master disk usage in Ubuntu system. For more information, please follow other related articles on the PHP Chinese website!