linux view files and folder sizes

  df: displays all the currently available space and file system usage

-H parameter represents the use of "Human-readable" output, which is a readable format GB, MB in size and other file systems.

[yayug@yayu ~]$ df -h  
Filesystem            Size  Used Avail Use% Mounted on  
/dev/sda1             3.9G  300M  3.4G   8% /  
/dev/sda7             100G  188M   95G   1% /data0  
/dev/sdb1             133G   80G   47G  64% /data1  
/dev/sda6             7.8G  218M  7.2G   3% /var  
/dev/sda5             7.8G  166M  7.2G   3% /tmp  
/dev/sda3             9.7G  2.5G  6.8G  27% /usr  
tmpfs                 2.0G     0  2.0G   0% /dev/shm  

 

    Disk space query file or folder: du

[root@bsso yayu]# du -h --max-depth=1 work/testing  
27M     work/testing/logs  
35M     work/testing  
  
[root@bsso yayu]# du -h --max-depth=1 work/testing/*  
8.0K    work/testing/func.php  
27M     work/testing/logs  
8.1M    work/testing/nohup.out  
8.0K    work/testing/testing_c.php  
12K     work/testing/testing_func_reg.php  
8.0K    work/testing/testing_get.php  
8.0K    work/testing/testing_g.php  
8.0K    work/testing/var.php  
  
[root@bsso yayu]# du -h --max-depth=1 work/testing/logs/  
27M     work/testing/logs/  
  
[root@bsso yayu]# du -h --max-depth=1 work/testing/logs/*  
24K     work/testing/logs/errdate.log_show.log  
8.0K    work/testing/logs/pertime_show.log  
27M     work/testing/logs/show.log  

 

Guess you like

Origin blog.csdn.net/a1058420631/article/details/89209689