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

Comments

Popular posts from this blog

Multi-programming with variable number of tasks(MVT) program in C

Multi-programming with fixed number of tasks(MFT) program in C

Linked file allocation program in C.