Home Linux How to get the number of Words, Characters and Rows within a text file on Linux via the Command Line?
 
 
 

How to get the number of Words, Characters and Rows within a text file on Linux via the Command Line?

PDF Print E-mail

Question: How to get the number of Words, Characters and Rows within a Text file on Linux via the Command Line?

 

Answer:

  • By using the wc command.
    wc = print newline, word, and byte counts for each file 
  • In the CLI type in the following command:
    wc -wcl < /home/user/textfile.txt

    textfile.txt = The file that we need to get the information from
    -w = print the word count
    -c = print the character count
    -l = print the line count
+/-
+/- Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Security Please input the anti-spam code that you can read in the image.
 

Go Daddy $7.49 .com Sale!