The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 05:08 PM
piping output to echo A1977 Shell Programming and Scripting 3 11-01-2006 08: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 07:55 AM
output of find command shriashishpatil UNIX for Dummies Questions & Answers 3 12-15-2005 11:17 AM
Piping output to while read Ultimodiablo Shell Programming and Scripting 3 11-26-2005 10:38 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-05-2006
435 Gavea 435 Gavea is offline
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
  #2 (permalink)  
Old 10-05-2006
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
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
Closed Thread

Bookmarks

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 03:00 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