Grepping large list of files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Grepping large list of files
# 1  
Old 02-22-2013
Grepping large list of files

Hi All,

I need help to know the exact command when I grep large list of files. Either using ls or find command. However I do not want to find in the subdirectories as the number of subdirectories are not fixed. How do I achieve that.

I want something like this:
Code:
find ./ -name "MYFILE*.txt" | wc -l  (excluding subdirectories).

I am using HPUnix.

Thanks
Angshuman

Last edited by vbe; 02-22-2013 at 10:04 AM.. Reason: code tags...
# 2  
Old 02-22-2013
??
ll MYFILE*.txt | wc -l ?
# 3  
Old 02-22-2013
Quote:
Originally Posted by angshuman
Hi All,

I need help to know the exact command when I grep large list of files. Either using ls or find command. However I do not want to find in the subdirectories as the number of subdirectories are not fixed. How do I achieve that.

I want something like this:
Code:
find ./ -name "MYFILE*.txt" | wc -l  (excluding subdirectories).

I am using HPUnix.

Thanks
Angshuman
I'm confused. You say you want to know how to grep a large list of file, but you have no grep in your code sample. Please try another way to explain what it is that you want to do.

Have you tried something simple like:
Code:
grep pattern MYFILE*.txt

If you have and it is failing with an argument list too long error, have you tried something like:
Code:
find . -name 'MYFILE*.txt' -exec grep pattern /dev/null {} +

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grepping verbal forms from a large corpus

I want to extract verbal forms from a large corpus of English. I have identified a certain number of patterns. Each pattern has the following structure SPACE word_CATEGORY where word refers to the verbal form and CATEGORY refers to the class of the verb The categories are identified as per the... (4 Replies)
Discussion started by: gimley
4 Replies

2. Shell Programming and Scripting

Grepping a list of words from one file in a master database of homophones

Hello, I am sorry if the title is confusing, but I need a script to grep a list of Names from a Source file in a Master database in which all the homophonic variants of the name are listed along with a single indexing key and store all of these in an output file. I need this because I am testing... (4 Replies)
Discussion started by: gimley
4 Replies

3. Shell Programming and Scripting

Performance issue in Grepping large files

I have around 300 files(*.rdf,*.fmb,*.pll,*.ctl,*.sh,*.sql,*.prog) which are of large size. Around 8000 keywords(which will be in the file $keywordfile) needed to be searched inside those files. If a keyword is found in a file..I have to insert the filename,extension,catagoery,keyword,occurrence... (8 Replies)
Discussion started by: millan
8 Replies

4. UNIX for Dummies Questions & Answers

grepping log files

I have a log file and I have two unique strings which represent the start and end of the text I want to obtain. How can I get all the text inbetween this start string and the end string? Thanks (2 Replies)
Discussion started by: chrisjones
2 Replies

5. UNIX for Dummies Questions & Answers

grepping between files

Hi I have two files File 1 alias HOME =.. alias DATA = ${DATA}/runtime1/test alias SQL = ${DATA}/find1dir/test alias SQL1 = ${HOME}/sql/orcl alias SQL2 =... (2 Replies)
Discussion started by: ssuresh1999
2 Replies

6. Shell Programming and Scripting

Searching for array in large list of files

I tried to make the title/subject detailed, but well.. have to keep it short as well. I am wanting to take a large list of strings, and search through a large list of files to hopefully find numerous matches. I am not sure the quickest way to do this though. // List of files file1.txt... (2 Replies)
Discussion started by: Rhije
2 Replies

7. UNIX for Dummies Questions & Answers

Command to list large files

Looking for a line to show all of the large files on a unix server (over 300mb)... Having problems finding anything that works... TIA! (13 Replies)
Discussion started by: search66
13 Replies

8. Shell Programming and Scripting

grepping many values from same files

Hi All, I am having a script in which I am greping some values and storing them from files with .err and .log extensions. I feel I can do it better.But How? Below is my piece of code. oneerrors=`egrep -i -n "one" *.err *.log` twoerrors=`egrep -i -n "two" *.err *.log` ... (2 Replies)
Discussion started by: Sreejith_VK
2 Replies

9. UNIX for Dummies Questions & Answers

List large files

Hi I need to list all files in the system: 1. Greater than specific size 2. All files sorted by size How can I do that? Thanks in advance. (2 Replies)
Discussion started by: GNMIKE
2 Replies

10. UNIX for Advanced & Expert Users

grepping lines out of files

Hi, I wonder if anyone can help me. I have a file with about 200 lines in it. I am wanting to set up a Count so that it picks out each line at turn and edits the line. However i am having trouble pulling out the specific line. I have a feeling it will be done somehow by a grep -n but what ever i... (2 Replies)
Discussion started by: mariner
2 Replies
Login or Register to Ask a Question