How To Remove the “New Folder .exe” Virus using the Linux Terminal

2009 September 9
tags: , ,
by jithinkr

The “New Folder .exe” virus is pretty annoying. Of course all viruses are annoying, but this one is frequently encountered by me (in my friends pen drives). The computers in our Computer Center are fully infected by these, and no pen drive is spared.

My friends come to me, to help them remove this New Folder Virus from their Pen Drives. They come to me, because I have Linux on my laptop, and it becomes easier to remove the virus. Just find and delete.

For those who do not know about this virus, let me give some background. This virus, creates a copy of itself within every folder present in the pen drive. And the name of those files is the name of the folder followed by .exe.

And this it does repetitively in every folder found inside the pendrive.

When my friends come to remove, I used to manually visit each and every folder and remove the file, until I found a way to do it easily.

Thanks to the find and rm command, I just have to run a single line of code. (Believe me, I thought I will have to write a script to do it!)

The Find Command in Linux

Find command finds any file with a particular pattern.

find -name “*\ .exe”

This line helps you find any file with the extension ” .exe”. Note the space before the period. That distinguishes the virus from an actual windows executable file. Now you have to remove these files. And this is how you do it.

find -name “*\ .exe” -exec rm -rf {} \;

That’s our required piece code, I mean line of code. So go to /media/pendrive and run this line. It will find out the New Folder virus files and remove it!

P.S. If you doubt this code, then please create a backup copy of whatever is in your pendrive, then run this code. If it doesn’t delete other files, then great! You can believe the code, you can believe me! :D

Blog Widget by LinkWithin

Technorati Tags: , ,

  • kra
    A note for the n00bs: pls don't try it if ur unsure.. but wth.. you'll just end up loosing all you EXE's.. who needs them anyway ?!
blog comments powered by Disqus