Awk script to find number of characters,words and lines in a file
Script & Output:
root@root:~/os# awk '{x+=length($0);y+=NF} END {print NR,x,y}' test1
10 385 95
root@root:~/os# awk '{x+=length($0);y+=NF} END {print NR,x,y}' 2b.sh
17 265 48
root@root:~/os# awk '{x+=length($0);y+=NF} END {print NR,x,y}' test1
10 385 95
root@root:~/os# awk '{x+=length($0);y+=NF} END {print NR,x,y}' 2b.sh
17 265 48
Comments
Post a Comment