df
做了一個偉大的工作概述。但是,如果我想在shell腳本中將變量設置爲磁盤上可用的字節數量呢?我怎樣才能*在bash中獲得磁盤上的可用字節數?
例子:
$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda 1111111111 2222222 33333333 10%/
tmpfs 44444444 555 66666666 1% /dev/shm
但我只是想回到33333333
(上/
可用的字節),而不是整個df
輸出。
? 'df | grep/dev/sda | awk'{print $ 4}'' –