1.Linux View a folder size: Du-sh/home/yangkun
du -sh /home/yangkun/164M /home/yangkun/
2.Linux View the size of all files in a directory: Du-h/home/yangkun
du -h/home/yangkun/4. 0K /home/yangkun/.config/abrt8. 0K /home/ yangkun/. config8. 0K /home/yangkun/db_back8. 0K /home/yangkun/. cache/abrt12k /home/yangkun/. Cache8. 0K /home/yangkun/. Oracle_ jre_usage23m /home/yangkun/soft4. 0K /home/yangkun/webpagedb20k /home/yangkun/. SSH 164M /home/yangkun/
3. View all sub-directories in the current directory folder size: Du-h--max-depth=1 (1 for the first level directory, 2 for the 2 level directory etc)
[Email protected] ~]$du-H--max-depth=18.0K./. config2.1G./Masala_back4.0K./db_back12k./. Cache8.0K./. oracle_jre_usage84k./. Gradle1.3G./soft357m./excel20k./.SSH8.0K./. PKI8.0K./. Vim4.2G.
4. View the upper G directory and sort: du-h--max-depth=1 |grep ' G ' |sort (-n Ascending-R reverse)
du -H--max-depth=1grep'G'1. 3G ./ Soft 2. 1G ./masala_back4. 2G .
5. View disk usage ratio, file system and its hang-in point: df-h
[Email protected] bin]$DF-hfilesystem Size used Avail use%mounted on/DEV/VDA1 59G 37G 20G the% /Devtmpfs3.9G0 3.9G0% /Devtmpfs3.9G0 3.9G0%/dev/Shmtmpfs3.9G 393M3.5G One% /Runtmpfs3.9G0 3.9G0%/sys/fs/Cgroup/DEV/VDB1 99G 23G 72G -% /mnt/DEV/VDC1 99G 64G 30G the%/mnt2
Linux View a folder size