LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 01: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, 02:40 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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, 03:50 AM   #3
babu198649
Member
 
Registered: Oct 2007
Posts: 160

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


Reply



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 03:30 PM
Cannot redirect files from egrep... Robhogg Linux - General 2 08-18-2007 02:58 PM
bash input/output redirect problem greno Programming 2 12-31-2006 03:23 PM
Redirect /dev/ttyS0 input/output to tty2 Kymbo Linux - General 1 09-07-2006 10:07 AM
How to redirect standard output of piped command to log file andrewstr Linux - General 10 02-04-2004 02:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:22 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration