The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
send email from address list and subject list paulds UNIX for Dummies Questions & Answers 2 06-27-2008 10:11 AM
perl script to list filenames that do not contain given string royalibrahim Shell Programming and Scripting 21 04-22-2008 01:55 PM
How to List and copy the files containing a string redlotus72 UNIX for Dummies Questions & Answers 11 09-28-2007 11:58 AM
Search a string from list of input files sivakumarvenkat UNIX for Dummies Questions & Answers 2 03-08-2006 06:08 PM
Extracting String from a list odogbolu98 Shell Programming and Scripting 4 06-01-2002 02:48 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-13-2008
Pep Puigvert Pep Puigvert is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 3
Lightbulb counting a list of string in a list of txt files

Hi there!

I have 150 txt files named chunk1, chunk2, ........., chunk150. I have a second file called string.txt with more than 1000 unique strings, house, dog, cat ... I want to know which command I should use to count how many times each string appears in the 150 files.

I have tried with a grep -c dog chunk* but then I get the count of all of the files and I have to do it separately for each of the strings.

The ideal solution would be an output saying:

dog 45
cat 69
house 92
song 45

Thanks a lot in advance.

Kind regards,
Pep
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:30 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0