【发布时间】:2014-03-24 21:15:00
【问题描述】:
我正在尝试使用 AWK 发布此命令最后一行的第二行(总磁盘空间):
df --total
我使用的命令是:
df --total | awk 'FNR == NF {print $2}'
但它并不正确。 还有其他方法吗?
【问题讨论】:
-
您也可以使用
--output指明您要打印的确切字段。例如,df --output=size | tail -1。更多信息How to select a particular column in linux df command