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
how to delete file names with $ in them orahi001 UNIX for Dummies Questions & Answers 2 04-11-2008 10:06 AM
How do manipulate file path and names siegfried Shell Programming and Scripting 2 09-28-2007 08:20 AM
Compare 2 list and delete certain names eltinator Shell Programming and Scripting 12 08-22-2007 09:45 PM
total number of files which have "aaa" in files whose names are File*_bbb* sudheshnaiyer UNIX for Dummies Questions & Answers 1 08-16-2007 11:34 AM
how to remove files with only numbers as file names? praveen_indramo Shell Programming and Scripting 6 06-07-2007 06:13 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 09-25-2001
Registered User
 

Join Date: Dec 2000
Location: Spain
Posts: 5
Post How can I delete files using a file that containt path and names?

Recentily i receive virus ninda and my network was files *.eml.
I find all *.eml with:

find / -name *.eml -print > virus

Virus has the path and name of the file,so, How can i delete all *.eml?

Thanks
Forum Sponsor
  #2  
Old 09-25-2001
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,613
First review that file called "virus" and be sure that you really want to delete all the files in it. Then you could use:
cat virus | xargs rm

Another option:

find / -name \*.eml -print | xargs rm

Remember to put a backslash before (or otherwise escape) the asterisk in your find statement. If you don't the find will only work right if your current directory contains no *.eml files.
  #3  
Old 09-25-2001
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,613
AlvaroD emailed me that the filenames contain embedded spaces. In that case, I would go with:

cat virus | xargs -i rm {}

and

find / -name \*.eml -exec rm {} \;
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:32 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0