6 WC Command Examples to Count Number of Lines, Words, Characters in Linux

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

23 Responses

  1. Thomas says:

    Is there a way to see how many times the word ‘the’ was used?

    • Ravi Saive says:

      @Thomas,

      To count occurrence of word in Linux text file, you should use following command.

      # cut -f 1 filename | grep -i "Yourword" | wc -l
      
  2. Pratap says:

    @Ravi,
    Thanks..but I am getting count from this command as wc -l <filename.txt
    How we can subtract 2 from this count ?

  3. Pratap badana says:

    How we can subtract 2 from count?

  4. Larry says:

    I’ve been using wc -l ‘find *.csv -type f’ for some time, but I would like to reduce the count of each file by 1 to not include the header records. Is this possible?

Leave a Reply to Thomas Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.