LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-29-2007, 11:53 PM   #1
limit_me
LQ Newbie
 
Registered: May 2007
Location: Kathmandu, Nepal
Distribution: Ubuntu 8.04
Posts: 10

Rep: Reputation: 0
shell command to remove all .exe file


hi,
i have two os residing in my computer, fedora core 6 and mucrosoft windows, but recently my windows is infected by some brontok(or something..).. and this virus in every folder of the hard disk,
I have important documents and files in my disk,
before i need to backup, i have to remove all the .exe virus in each folder. that is time consuming if removed individually..

actually i wrote a simple shell command like this:

rm -v `find /mnt/d -name '*.exe' -print`

this removed all the files in the folder that has no spaces between the folder name.. but for the folder with spaces the following error was returned...

rm: cannot remove `./Linux': No such file or directory
rm: cannot remove `World/Linux': No such file or directory
rm: cannot remove `Distributions/Linux': No such file or directory
rm: cannot remove `Distributions.exe': No such file or directory

Can anyone help me !!!
 
Old 05-30-2007, 12:04 AM   #2
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Code:
find . -name '*.exe' -exec rm -v {} \;
-twantrd
 
Old 05-30-2007, 12:12 AM   #3
limit_me
LQ Newbie
 
Registered: May 2007
Location: Kathmandu, Nepal
Distribution: Ubuntu 8.04
Posts: 10

Original Poster
Rep: Reputation: 0
thanks

thanks,

this worked out,
 
  


Reply

Tags
programming, shell


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
command or shell script to print line range from file minil Programming 3 12-28-2005 09:05 AM
Script File: Parsing command sent to shell cheema Programming 1 07-01-2005 01:54 PM
execute shell command inside of tcl file khucinx Programming 1 07-05-2004 02:29 PM
remove directory with shell command? khucinx Programming 2 05-19-2004 01:59 PM
does the rm command permanetly remove a file? flyboy320 Linux - General 4 03-07-2002 01:01 AM

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

All times are GMT -5. The time now is 02:35 PM.

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