wc

print newline, word, and byte counts for each file

copy
22
1
ls -l | wc -lCount the number of files/directory's in the current directory

details |

copy
10
1
wc -l `find . -name "*.[ch]" -print` | tail -1 | awk '{print $1}'Find the total number of lines in for all *.c and *.h in all sub directory's

details |

copy
7
1
wc -l *.[ch] | tail -1 | awk '{print $1}'Count the number of words in all *.c and *.h files in the current directory

details |

copy
7
0
wc -cw myfile.txtCount the number of bytes and words in myfile.txt.

details |

copy
6
0
head -20 myfile.txt | tail -1 | wc -wCount how many words on line 20 of myfile.txt

details |

copy
4
0
wc myfile.txtDisplay info about myfile.txt 80 = Lines, 456 = Words, 2800 = Characters

details |

copy
5
0
who | wc -lCount the number of users logged into the system

details |

copy
5
0
find . -name '*.[ch]' -print0 | wc -L --files0-from=- | tail -n1Find's the length of the longest line in any *.c or *.h file in the current hierarchy.

details |

copy
3
0
wc -cw myfile.txtCount the number of bytes and words in myfile.txt

details |

copy
3
2
ps -e | wc -lCount the number of running process on the system.

details |

copy
4
0
wc -m myfile.txtCount the number of of characters in myfile.txt

details |