Dreevoo.com | Online Learning and Knowledge Sharing
 
Home | Programs | Other applications | Open source programs | How to count number of words and rows in Linux files
Guest
Click to view your profile
Topics
Programs
Languages
Recipes
Home
Shortcuts
 
 

How to count number of words and rows in Linux files

Linux wc is a simple command that enables you to find out how many words and rows does a text file or output contain.

 
  Author: mat | Version: Ubuntu 12.04 | 24th July 2013 |  
 
 
1.
 

As already mentioned we will use a wc command.

As an example let's take a file names text.txt which contains text you can see on the image.

Recommended tutorial:



 
 
2.
 

Usage of the command is pretty straight forward.

wc file_name

In our case:
wc text.txt

We get three numbers as a result
First number is the number of rows, second number represent the number of words and the third number of characters.

 
 
3.
 

The wc command can also be applied with all other programs or commands that give an output as a result.

In this case we only need to add | wc

Let's take the folder listing ls -al as an example:

ls -al | wc

 
 
 
   
  Please login to post a comment
  Click to open user profile  
thefansbuzz, 19th Feb 2023, 7:46 PM
Get Cheapest SMM Panel social media panel services from Thefansbuzz that provides a wide range of social media services including Facebook advertising, Instagram ads, Google Ads, and much more. Get Cheapest social media panel services helps its customers grow their business by providing them with the best solutions. Visit our website at: https://thefansbuzz.com/
 
   
 
 
online learning made for people
Dreevoo.com | CONTRIBUTE | FORUM | INFO