版权声明: https://blog.csdn.net/gramdog/article/details/80397728
原文链接:https://blog.csdn.net/github_33736971/article/details/54286736
$NF表示最后一个列(field),即输出最后一个字段的内容。如下所示:
[root@localhost SHELL]# free -m | grep buffers\/
-/+ buffers/cache: 1815 1859
[root@localhost SHELL]# free -m | grep buffers\/ | awk '{print $NF}'
1859
[root@localhost SHELL]# free -m | grep buffers\/ | awk '{print NF}'
4
[root@localhost SHELL]#