how to use the grep to find detail in a file


 
Thread Tools Search this Thread
Operating Systems Solaris how to use the grep to find detail in a file
# 1  
Old 03-10-2004
how to use the grep to find detail in a file

I need to search say a customer account number in a selection of files using 'grep', for example, I need to do the following;

using grep
to locate '020 117 in the mail files (mail files-txt)

cheers
# 2  
Old 03-10-2004
grep 'grep' www.unix.com | wc -l

695

Try searching the site, you'll learn a great deal more. There are many topics concerning grep on this site.

Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Grep: Retrieve two strings from one file to find them anyone on line in another file

I am having trouble matching *two* strings from one file anywhere in a line of a second file, and could use some help getting this figured out. My preference would be to use grep for this because I would like to take advantage of its -A option. The latter is due to the fact that I would like both... (2 Replies)
Discussion started by: jvoot
2 Replies

2. Shell Programming and Scripting

Detail on For loop for multiple file input and bash variable usage

Dear mentors, I just need little explanation regarding for loop to give input to awk script for file in `ls *.txt |sort -t"_" -k2n,2`; do awk script $file done which sorts file in order, and will input one after another file in order to awk script suppose if I have to input 2 or... (4 Replies)
Discussion started by: Akshay Hegde
4 Replies

3. UNIX for Dummies Questions & Answers

Print file name when running grep from within find

Solaris 10 When running grep from within find command (don't know the technical term for 'running from within' ) , find command returns only the line which contains the pattern. Is there any way to get the file name printed as well ? $ pwd /opt/testdir/anotherDir $ $ $ cat findme.txt... (3 Replies)
Discussion started by: omega3
3 Replies

4. Shell Programming and Scripting

How to use grep & find command to find references to a particular file

Hi all , I'm new to unix I have a checked project , there exists a file called xxx.config . now my task is to find all the files in the checked out project which references to this xxx.config file. how do i use grep or find command . (2 Replies)
Discussion started by: Gangam
2 Replies

5. Shell Programming and Scripting

File find | xargs grep for pattern file

Folks I've been struggling this with for far too liong now and need your help! I've been happily using grep for a search of a directory, to list the files which contain a string: find . -type f -mtime -5 -print | xargs grep -l 'invoiceID=\"12345\"' Now the list of 'invoiceID' I am... (4 Replies)
Discussion started by: daveaasmith
4 Replies

6. UNIX for Dummies Questions & Answers

find file grep it and print file name

i am trying to search a few hundred release note text files for a certain word. however when i use the below command i can find a file that contains it but i dont know the file name. how can i change this command to output the name of the file that grep was successful in? find builds -name... (4 Replies)
Discussion started by: borderblaster
4 Replies

7. Shell Programming and Scripting

find grep and list file name

find . -exec grep "something" {} \; this command only show the grep data but doesn't show the file name and path, how to show file path in this command? (4 Replies)
Discussion started by: bill.zheng
4 Replies

8. Shell Programming and Scripting

How to grep a number in a file to find them in another file

Hi, I tried to simulate some example in Shell particularly finding item and matching in another file. A very simple example:- Basically I have 2 files, file A and file B. In file A, I have columns of fields such that:- aaa 107 bbb 108 ccc 109 In file B, I have columns of fields... (7 Replies)
Discussion started by: ahjiefreak
7 Replies

9. Shell Programming and Scripting

change record detail...in file

hello, I have a file with the following record: a.txt AAjohn10123403 AAmary10298411 AAcat120192a1030 AApeter094857 AAmaybb019485 I have a list called b.txt, if matched the name and it will change to new name (which is after space) john1 cancel cat12 cat12 peter peter mary1... (5 Replies)
Discussion started by: happyv
5 Replies

10. UNIX for Dummies Questions & Answers

Getting detail out of a log file...

I'd like to peruse a log file and from it generate another file from the first instance of "Jul 11" to the first instance of "Jul 18" within the log file. (3 Replies)
Discussion started by: Cameron
3 Replies
Login or Register to Ask a Question