wc :- The wc command is a utility used in Unix and Unix-like operating systems to count the number of lines, words, and characters in a file or input. It can also display the size of a file in bytes.
- wc filename.txt :- Count the number of lines, words, and characters in a file.
wc filename.txt
-
-l :- Display only the number of lines in a file.
wc -l filename.txt
-
-w :- Display only the number of words in a file.
wc -w filename.txt
-
-c :- Display only the number of characters in a file.
wc -c filename.txt
-
-L :- Display the length of the longest line in a file.
wc -L filename.txt