FIND/GREP problem


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers FIND/GREP problem
# 1  
Old 11-13-2006
FIND/GREP problem

When I enter the command below grep appears to be returning a file it shouldn't.

find . -name "*.*" -exec grep "testing" {} /dev/null \;
.Smilieps3Mailfile
./SSI.ksh: # create TECHOUT dummy for test for testing purposes
./ftprimi1.ksh:# before running job in prod... change FTP to go to rimi instead of rad box(testing)
./pharm_alert.ksh:# send mail for testing, but not in prod

The file, ops3Mailfile does not contain the search string testing, why does this command continually pull this file? If I rerun the above using -type option instead of -name for the find command then the proper files are returned. Also, if you look at the path returned for this file it lists .Smilieps3MailFile instead of ./ops3MailFile as one would expect.

Anyone have any ideas why this file is returned? If you use grep on this directory without the find then the proper list of files is returned.

Thanks

D
# 2  
Old 11-13-2006
P.S. the smiley face should be a colon an an O
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sed Or Grep Problem OR Terminal Problem?

I don't know if you guys get this problem sometimes at Terminal but I had been having this problem since yesterday :( Maybe I overdid the Terminal. Even the codes that used to work doesn't work anymore. Here is what 's happening: * I wanted to remove lines containing digits so I used this... (25 Replies)
Discussion started by: Nexeu
25 Replies

2. UNIX for Dummies Questions & Answers

find/xargs/*grep: find multi-line empty "try-catch" blocks - eg, missing ; not in a commented block

How can I recursively find all files in a directory and print out the file and first line number of any text blocks that match the below cases? This would seem to involve find, xargs, *grep, regex, etc. In summary, I want to find so-called empty "try-catch blocks" that do not contain code... (0 Replies)
Discussion started by: lifechamp
0 Replies

3. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 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. UNIX for Dummies Questions & Answers

grep or find ?

I have a file called 'test.txt' that contains alphanumeric charecters. The file contains the word 'SBE' followed by other alphabets many times. For example, the file will contain: SBE334GH and also will have SBE77Y8I. When i do grep 'SBE*' test.txt - it outputs the entire file. Can you... (5 Replies)
Discussion started by: DallasT
5 Replies

6. Shell Programming and Scripting

find grep whitespace problem

Hey guys iv written a basic function to ask for input location to find then grep a certain string in the file at the location of the find. For some reason it finds the file with the certain string it however it says directory not found on each string before the whitespace eg enter location to... (5 Replies)
Discussion started by: musicmancanora4
5 Replies

7. Shell Programming and Scripting

Using Find w/ Grep?

Hey, I have a Find command like: find $searchDir -type f and this returns a list of files under the directory, which is all good, but, I want to filter that search for files that contain the string "people" I tried something like: find $searchDir -type f -exec grep "people" '{}'... (2 Replies)
Discussion started by: beefeater267
2 Replies

8. UNIX for Dummies Questions & Answers

find , grep

HI what is the difference between find and grep if I want to find all the files from different directories which contain "ORA" error, and the line number in each file which has ORA error should I use pipeline ? thanks James (3 Replies)
Discussion started by: james94538
3 Replies

9. Shell Programming and Scripting

grep is not working, please find out the problem

HI Friends, Traxlist.txt --this is my file contains this txt ------------- 108042708190000.txt 108042708190001.txt 112040108174516.txt 112042708173000.txt 112042708174508.txt 112050108173000.txt 113042708100500.txt 113042708103026.txt i have varible called... (3 Replies)
Discussion started by: kittusri9
3 Replies

10. UNIX for Dummies Questions & Answers

grep and find

Hey, I have a question about using grep and find together to locate all C programs in a directory containing certain words and open the vi editor with each file. I'm not sure how to do this in one command (as in one line). I know find has a "-exec" option that can call vi, but how do you combine... (1 Reply)
Discussion started by: MEllis5
1 Replies
Login or Register to Ask a Question