Get free disk space with df to just display free space in kb?

后端 未结 4 1135
谎友^
谎友^ 2020-12-13 13:35

I\'m trying to output the amount of free disk space on the filesystem /example.

If I run the command df -k /example I can get good informat

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 14:19

    Show interesting columns only

     df /example --total -k -h  --output=source,avail
    
    • --total = grand total at the end
    • -k = block size 1K
    • -h = human readable
    • --output=[FIELD_LIST] column list to show separated by ","

    Not totally standard (I have seen --output just in Ubuntu man pages), in this case Awk and others just to remove columns are not necessary.

提交回复
热议问题