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
piping oracle output to a file? satnamx Shell Programming and Scripting 13 03-19-2008 02:08 PM
piping output to echo A1977 Shell Programming and Scripting 3 11-01-2006 05:58 AM
How do I output or echo NONE if grep does not find anything? jojojmac5 UNIX for Dummies Questions & Answers 2 07-13-2006 04:55 AM
output of find command shriashishpatil UNIX for Dummies Questions & Answers 3 12-15-2005 08:17 AM
Piping output to while read Ultimodiablo Shell Programming and Scripting 3 11-26-2005 07:38 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-05-2006
Registered User
 

Join Date: Oct 2003
Location: Brazil
Posts: 42
piping the output of find command to grep

Hi,

I did not understand why the following did not work out as I expected:

find . -name "pqp.txt" | grep -v "Permission"


I thought I would be able to catch whichever paths containing my pqp.txt file without receiving the display of messages such as "find: cannot access... Permisson denied", but it did not work.

Anyone could explain me the reason why ?

Thanks,
Abraham
Reply With Quote
Forum Sponsor
  #2  
Old 10-05-2006
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,029
what you're "grepping out' is displayed to stderr, not stdout.

redirect stderr [2] to stdout [1] like so:
Code:
find . -name 'pqp.txt' 2>&1 | grep -v 'Permission'
or better yet redirect stderr to '/dev/null':
Code:
find . -name 'pqp.txt' 2>/dev/null
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:38 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0