du命令-查看占用磁盤空間大的文件夾與文件


du命令會查詢當前目錄下所有文件的大小並打印顯示

參數

-c 顯示當前目錄的總用量

[root@localhost ~]# du -c
4160    ./bin
6000    .
6000    總用量

-h 已K\M\G來顯示使用量

[root@localhost ~]# du -h
4.1M    ./bin
5.9M    .

-s 顯示當前目錄的總和

[root@localhost ~]# du -s
6000    .

 

常用方式

du -ch #查詢當前目錄下所有文件夾占用磁盤的大小

[root@localhost ~]# du -ch
4.1M    ./bin
5.9M    .
5.9M    總用量

du -ch * #查詢當前目錄下不隱藏的文件夾與文件占用磁盤的大小

[root@localhost ~]# du -ch *
4.0K    anaconda-ks.cfg
4.1M    bin
32K     install.log
12K     install.log.syslog
1.7M    nload_bin.tar.gz
5.9M    總用量

du -ch .[!.]* #查看當前目錄下隱藏文件占用磁盤的大小

[root@localhost ~]# du -ch .[!.]*
8.0K    .bash_history
4.0K    .bash_logout
4.0K    .bash_profile
4.0K    .bashrc
4.0K    .cshrc
0       .my.cnf
4.0K    .mysql_history
4.0K    .nload
4.0K    .tcshrc
8.0K    .viminfo
4.0K    .Xauthority
48K     總用量


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM