The UNIX and Linux Forums
>
Top Forums
>
UNIX for Dummies Questions & Answers
Shell script to search for text in a file and copy file
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
Shell script to search for text in a file and copy file
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
08-03-2007
Yogesh Sawant
Part Time Moderator and Full Time Dad
Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 827
this will list all files in the given directory that contain the given string:
Code:
find /path/to/dir/ * | xargs grep abcde1234 | cut -d ":" -f1 | uniq
remaining is left for you to do
Yogesh Sawant
View Public Profile
Visit Yogesh Sawant's homepage!
Find all posts by Yogesh Sawant