五月综合激情婷婷六月,日韩欧美国产一区不卡,他扒开我内裤强吻我下面视频 ,无套内射无矿码免费看黄,天天躁,日日躁,狠狠躁

新聞動態(tài)

Linux磁盤管理之df命令詳細介紹和使用實例(統(tǒng)計文件或目錄的磁盤占用情況)

發(fā)布日期:2022-03-15 16:06 | 文章來源:gibhub

1.命令格式:

du[選項][文件]

2.命令功能:

顯示每個文件和目錄的磁盤使用空間。

3.命令參數(shù):

-a或-all顯示目錄中個別文件的大小。

-b或-bytes顯示目錄或文件大小時,以byte為單位。

-c或--total除了顯示個別目錄或文件的大小外,同時也顯示所有目錄或文件的總和。

-k或--kilobytes以KB(1024bytes)為單位輸出。

-m或--megabytes以MB為單位輸出。

-s或--summarize僅顯示總計,只列出最后加總的值。

-h或--human-readable以K,M,G為單位,提高信息的可讀性。

-x或--one-file-xystem以一開始處理時的文件系統(tǒng)為準,若遇上其它不同的文件系統(tǒng)目錄則略過。

-L<符號鏈接>或--dereference<符號鏈接>顯示選項中所指定符號鏈接的源文件大小。

-S或--separate-dirs顯示個別目錄的大小時,并不含其子目錄的大小。

-X<文件>或--exclude-from=<文件>在<文件>指定目錄或文件。

--exclude=<目錄或文件>略過指定的目錄或文件。

-D或--dereference-args顯示指定符號鏈接的源文件大小。

-H或--si與-h參數(shù)相同,但是K,M,G是以1000為換算單位。

-l或--count-links重復(fù)計算硬件鏈接的文件。

4.使用實例:

實例1:顯示目錄或者文件所占空間

命令:du

輸出:


復(fù)制代碼
代碼如下:

[root@localhost test]# du
608 ./test6
308 ./test4
4 ./scf/lib
4 ./scf/service/deploy/product
4 ./scf/service/deploy/info
12 ./scf/service/deploy
16 ./scf/service
4 ./scf/doc
4 ./scf/bin
32 ./scf
8 ./test3
1288 .
[root@localhost test]#

說明:

只顯示當前目錄下面的子目錄的目錄大小和當前目錄的總的大小,最下面的1288為當前目錄的總大小

實例2:顯示指定文件所占空間

命令:dulog2012.log

輸出:


復(fù)制代碼
代碼如下:

[root@localhost test]# du log2012.log
300 log2012.log
[root@localhost test]#

實例3:查看指定目錄的所占空間

命令:duscf

輸出:


復(fù)制代碼
代碼如下:

[root@localhost test]# du scf
4 scf/lib
4 scf/service/deploy/product
4 scf/service/deploy/info
12 scf/service/deploy
16 scf/service
4 scf/doc
4 scf/bin
32 scf
[root@localhost test]#

實例4:顯示多個文件所占空間

命令:dulog30.tar.gzlog31.tar.gz

輸出:


復(fù)制代碼
代碼如下:

[root@localhost test]# du log30.tar.gz log31.tar.gz
4 log30.tar.gz
4 log31.tar.gz
[root@localhost test]#

實例5:只顯示總和的大小

命令:du-s

輸出:


復(fù)制代碼
代碼如下:

[root@localhost test]# du -s
1288 .
[root@localhost test]# du -s scf
32 scf
[root@localhost test]# cd ..
[root@localhost soft]# du -s test
1288 test
[root@localhost soft]#

實例6:方便閱讀的格式顯示

命令:du-htest

輸出:


復(fù)制代碼
代碼如下:

[root@localhost soft]# du -h test
608K test/test6
308K test/test4
4.0K test/scf/lib
4.0K test/scf/service/deploy/product
4.0K test/scf/service/deploy/info
12K test/scf/service/deploy
16K test/scf/service
4.0K test/scf/doc
4.0K test/scf/bin
32K test/scf
8.0K test/test3
1.3M test
[root@localhost soft]#

實例7:文件和目錄都顯示

命令:du-ahtest

輸出:


復(fù)制代碼
代碼如下:

[root@localhost soft]# du -ah test
4.0K test/log31.tar.gz
4.0K test/test13.tar.gz
0 test/linklog.log
0 test/test6/log2014.log
300K test/test6/linklog.log
0 test/test6/log2015.log
4.0K test/test6/log2013.log
300K test/test6/log2012.log
0 test/test6/log2017.log
0 test/test6/log2016.log
608K test/test6
0 test/log2015.log
0 test/test4/log2014.log
4.0K test/test4/log2013.log
300K test/test4/log2012.log
308K test/test4
4.0K test/scf/lib
4.0K test/scf/service/deploy/product
4.0K test/scf/service/deploy/info
12K test/scf/service/deploy
16K test/scf/service
4.0K test/scf/doc
4.0K test/scf/bin
32K test/scf
4.0K test/log2013.log
300K test/log2012.log
0 test/log2017.log
0 test/log2016.log
4.0K test/log30.tar.gz
4.0K test/log.tar.bz2
4.0K test/log.tar.gz
0 test/test3/log2014.log
4.0K test/test3/log2013.log
8.0K test/test3
4.0K test/scf.tar.gz
1.3M test
[root@localhost soft]#

實例8:顯示幾個文件或目錄各自占用磁盤空間的大小,還統(tǒng)計它們的總和

命令:du-clog30.tar.gzlog31.tar.gz

輸出:


復(fù)制代碼
代碼如下:

[root@localhost test]# du -c log30.tar.gz log31.tar.gz
4 log30.tar.gz
4 log31.tar.gz
8 總計
[root@localhost test]#

加上-c選項后,du不僅顯示兩個目錄各自占用磁盤空間的大小,還在最后一行統(tǒng)計它們的總和。

實例9:按照空間大小排序

命令:du|sort-nr|more

輸出:


復(fù)制代碼
代碼如下:

[root@localhost test]# du|sort -nr|more
1288 .
608 ./test6
308 ./test4
32 ./scf
16 ./scf/service
12 ./scf/service/deploy
8 ./test3
4 ./scf/service/deploy/product
4 ./scf/service/deploy/info
4 ./scf/lib
4 ./scf/doc
4 ./scf/bin
[root@localhost test]#

實例10:輸出當前目錄下各個子目錄所使用的空間

命令:du-h--max-depth=1

輸出:


復(fù)制代碼
代碼如下:

[root@localhost test]# du -h --max-depth=1
608K ./test6
308K ./test4
32K ./scf
8.0K ./test3
1.3M .
[root@localhost test]#

香港服務(wù)器租用

版權(quán)聲明:本站文章來源標注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。

實時開通

自選配置、實時開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對1客戶咨詢顧問

在線
客服

在線客服:7*24小時在線

客服
熱線

400-630-3752
7*24小時客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部