The UNIX and Linux Forums  

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
How can find Null value in If condition koti_rama Shell Programming and Scripting 2 07-17-2007 06:20 AM
Grep for NULL for a specific field in a unix file sureshg_sampat UNIX for Dummies Questions & Answers 5 11-24-2006 09:21 AM
Grep for NULL in a pipe delimited file sureshg_sampat Shell Programming and Scripting 5 11-21-2006 06:15 AM
Find files which contain a null character Bab00shka UNIX for Dummies Questions & Answers 5 12-16-2005 10:41 AM
GREP a string with NULL Character weerich UNIX for Dummies Questions & Answers 3 09-18-2001 02:30 PM

 
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 07-27-2008
gaurav_s gaurav_s is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 1
Using /dev/null with grep and find

Hi,
I am trying to display the filename in which a string was found after using find and grep. For this after some googling I found that this works:

find -name "*.java" -exec grep "searchStr" {} /dev/null \;

I wanted to know the difference between the above and the following:

find -name "*.java" -exec grep "searchStr" {} \;

When I use the first command with /dev/null I get the filename as well in which the string was found which is not the case in second. Since /dev/null is a null device how does the flow work such that appending it starts displaying the file name.

TIA
Gaurav
 

Bookmarks

Tags
devnull, find, grep

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 12:58 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