LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-27-2007, 02:43 AM   #1
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Rep: Reputation: 30
Question how to redirect the output of find command to input of egrep


hi
how to redirect the output of find command to input of egrep.
an example command would be helpful.
 
Old 12-27-2007, 03:40 AM   #2
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
Originally Posted by babu198649 View Post
how to redirect the output of find command to input of egrep.
an example command would be helpful
You can use the xargs command. Example:
Code:
find . -type f | xargs egrep xxx
Be advised that this will cause problems with file/directory names that contain spaces and stuff like that. IMHO you are much better-off using the -exec built-in option of the find command. Example:
Code:
find . -type f -exec egrep xxx {} \;
 
Old 12-27-2007, 04:50 AM   #3
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
thanks.......
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
egrep to find a command not found string romainp Linux - General 1 09-07-2007 04:30 PM
Cannot redirect files from egrep... Robhogg Linux - General 2 08-18-2007 03:58 PM
bash input/output redirect problem greno Programming 2 12-31-2006 04:23 PM
Redirect /dev/ttyS0 input/output to tty2 Kymbo Linux - General 1 09-07-2006 11:07 AM
How to redirect standard output of piped command to log file andrewstr Linux - General 10 02-04-2004 03:07 PM


All times are GMT -5. The time now is 05:27 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration