Skip to content

Latest commit

 

History

History
39 lines (23 loc) · 817 Bytes

wc Command.md

File metadata and controls

39 lines (23 loc) · 817 Bytes

wc command

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			

wc command switch

  • -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