• linux awk


     

    1. [root@k8s-node-01 zwf]# ll
    2. total 505244
    3. drwxrwxr-x 8 root root 191 Sep 1 08:45 eclipse
    4. -rwxrwxrwx 1 root root 344056669 Sep 1 08:43 eclipse-jee-oxygen-3-linux-gtk-x86_64.tar.gz
    5. drwxrwxrwx 7 root root 121 Sep 1 10:42 eclipse_workspace
    6. drwxrwxrwx 8 10 143 255 Apr 11 2015 jdk1.8.0_45
    7. -rwxrwxrwx 1 root root 173271626 Sep 1 08:26 jdk-8u45-linux-x64.tar.gz
    8. -rw-r--r-- 1 root root 34023 Sep 1 10:57 zengwenfeng_hadoop.txt
    9. [root@k8s-node-01 zwf]#
    10. [root@k8s-node-01 zwf]#
    11. [root@k8s-node-01 zwf]#
    12. [root@k8s-node-01 zwf]#
    13. [root@k8s-node-01 zwf]# free
    14. total used free shared buff/cache available
    15. Mem: 5178128 4213312 145584 304424 819232 365676
    16. Swap: 0 0 0
    17. [root@k8s-node-01 zwf]#
    18. [root@k8s-node-01 zwf]# free | awk '/Mem/{field $3}'
    19. [root@k8s-node-01 zwf]#
    20. [root@k8s-node-01 zwf]# free | awk '/Mem/{print $3}'
    21. 4209796
    22. [root@k8s-node-01 zwf]#
    23. [root@k8s-node-01 zwf]# free | awk '/Mem/{print $4}'
    24. 145148
    25. [root@k8s-node-01 zwf]#
    26. [root@k8s-node-01 zwf]#
    27. [root@k8s-node-01 zwf]#
    28. [root@k8s-node-01 zwf]# df
    29. Filesystem 1K-blocks Used Available Use% Mounted on
    30. devtmpfs 2572168 0 2572168 0% /dev
    31. tmpfs 2589064 0 2589064 0% /dev/shm
    32. tmpfs 2589064 263892 2325172 11% /run
    33. tmpfs 2589064 0 2589064 0% /sys/fs/cgroup
    34. /dev/mapper/centos-root 40137576 30959080 9178496 78% /
    35. /dev/mapper/centos-home 19593216 37908 19555308 1% /home
    36. /dev/sda1 1038336 213076 825260 21% /boot
    37. /dev/sr0 4669162 4669162 0 100% /run/media/root/CentOS 7 x86_64
    38. tmpfs 517816 28 517788 1% /run/user/0
    39. overlay 40137576 30959080 9178496 78% /var/lib/docker/overlay2/c2b17bbce8881ca3d62248e2c09bbf0692c5d108f4c161f29948f1a6b258bd07/merged
    40. shm 65536 0 65536 0% /var/lib/docker/containers/66a8cb92961523bb02f974c4045889e3b43f74379d152041aa3b8e56ee7b0600/shm
    41. overlay 40137576 30959080 9178496 78% /var/lib/docker/overlay2/4ed8579835fa5c4132047551b5a48706563f6632a1c3d529bc1c2694bcbc9d78/merged
    42. shm 65536 0 65536 0% /var/lib/docker/containers/6ea3ce9e48b251247393b8f8a15c5a3d314f6c6057b4b8285fbfede26cabd9d4/shm
    43. overlay 40137576 30959080 9178496 78% /var/lib/docker/overlay2/6d5e1204d0abe9da16a493b17bf73a07226391f9bf1603b8ab6a42d9066b86f2/merged
    44. shm 65536 0 65536 0% /var/lib/docker/containers/241416027da3596b7d4fffb5df834394272338a8464834b2f4fc15144a5df9f0/shm
    45. overlay 40137576 30959080 9178496 78% /var/lib/docker/overlay2/fafb1447c532c17dcb688f58c841b20085b02f4e281e2de2888d7dae8a41da32/merged
    46. shm 65536 0 65536 0% /var/lib/docker/containers/1c8ee2959538109f6240e6520c24cc15fa1daa04a242a0949b8eb341f5225dae/shm
    47. [root@k8s-node-01 zwf]#
    48. [root@k8s-node-01 zwf]#
    49. [root@k8s-node-01 zwf]# df /
    50. Filesystem 1K-blocks Used Available Use% Mounted on
    51. /dev/mapper/centos-root 40137576 30959080 9178496 78% /
    52. [root@k8s-node-01 zwf]#
    53. [root@k8s-node-01 zwf]#
    54. [root@k8s-node-01 zwf]# df / | awk '/\//{print $4}'
    55. 9178496
    56. [root@k8s-node-01 zwf]#
    57. [root@k8s-node-01 zwf]#

  • 相关阅读:
    SpringBoot项目基础git
    Kubernetes 之 StatefulSet基本原理
    【Vue】vuex mapActions和mapMutations
    Dash初探:如何将Label和Dropdown放在一行
    使用Jmeter+ant进行接口自动化测试(数据驱动)
    K8S的安装kubernetes-dashboard服务起来了,访问不到解决
    k8s--基础--24.1--efk--介绍
    [附源码]java毕业设计基于web的硕士研究生入学考务管理
    c#给多线程传参的几种方式
    postgresSQL 数据库本地创建表空间读取本地备份SQL文件
  • 原文地址:https://blog.csdn.net/spencer_tseng/article/details/126923997