1、测试数据
[root@centos7 test4]# ls test.txt [root@centos7 test4]# cat test.txt d j k j x m y e s g j i x v b d z c e t
2、统计行数和列数
[root@centos7 test4]# ls
test.txt
[root@centos7 test4]# cat test.txt
d j k j
x m y e
s g j i
x v b d
z c e t
[root@centos7 test4]# awk '{i++} END {print FILENAME, i, NF}' test.txt ## 5行4列
test.txt 5 4
原创文章,作者:506227337,如若转载,请注明出处:https://blog.ytso.com/tech/aiops/245048.html