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
Using cp -r command to selectively omit *.dat files while copying a directory. d_sai_kumar UNIX for Dummies Questions & Answers 5 07-18-2008 07:48 AM
Change All File Names in a Directory andou UNIX for Dummies Questions & Answers 8 01-22-2008 09:06 PM
Command to list directory names only stevefox UNIX for Dummies Questions & Answers 6 11-29-2007 08:06 PM
copying a file from one directory to another soujanya_srk UNIX for Dummies Questions & Answers 5 11-02-2007 05:40 AM
File and Directory Names become hidden dbinsol1 UNIX for Advanced & Expert Users 10 05-29-2002 10:58 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-17-2005
Kartheg Kartheg is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 15
Red face Copying file names returned from a grep command into another directory

When I do the following :

grep -l "string" *,

I get a list of file names returned. Is there a way to copy the files returned from the list into another directory ?.

Thanks.

Last edited by Kartheg; 11-17-2005 at 11:54 AM..
  #2 (permalink)  
Old 11-17-2005
ashterix ashterix is offline
Registered User
  
 

Join Date: Nov 2005
Location: cyberjaya
Posts: 85
$ cp `grep -l "string" *` tmp/
  #3 (permalink)  
Old 11-17-2005
Kartheg Kartheg is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 15
I get the following :-

cp:cannot access grep -l string *
  #4 (permalink)  
Old 11-17-2005
dangral dangral is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2002
Posts: 699
Make sure you are using backticks (above the tab key on a standard keyboard).
  #5 (permalink)  
Old 11-17-2005
Kartheg Kartheg is offline
Registered User
  
 

Join Date: Oct 2005
Posts: 15
Yes, That works !

Thank you ashterix & dangral for your help.
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 10:57 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