Find the answer to your Linux question:
Results 1 to 5 of 5
Just scanned a pendrive and found a ton of windows viruses and i would like to delete all .exe because clamav detected them as a worm I just tried ls ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru Juan Pablo's Avatar
    Join Date
    Mar 2006
    Location
    /home/south_america/ecuador/quito
    Posts
    2,064

    Deleting all .exe files from a pendrive


    Just scanned a pendrive and found a ton of windows viruses and i would like to delete all .exe because clamav detected them as a worm

    I just tried

    ls -Ra | rm *.exe but it didn't work

    ps: the pendrive has a deep directory tree

    Thanks in advance!
    Put your hand in an oven for a minute and it will be like an hour, sit beside a beautiful woman for an hour and it will be like a minute, that is relativity. --Albert Einstein
    Linux User #425940

    Don't PM me with questions, instead post in the forums

  2. #2
    Just Joined! Alex Stan's Avatar
    Join Date
    Aug 2006
    Location
    Hamilton, Ontario
    Posts
    90
    How many files you have? Can't you delete them manually?
    Or maybe you could do a search and delete them in the search window, you need a gui for that(that works in windows)

  3. #3
    Linux Guru Juan Pablo's Avatar
    Join Date
    Mar 2006
    Location
    /home/south_america/ecuador/quito
    Posts
    2,064
    The virus created one per folder (including subfolders), there's about 200 .exe there.
    I don't have windows near, i'm doing this to help a friend.
    Because when you insert the pendrive on a windows computer it is instantly loaded into the machine
    Put your hand in an oven for a minute and it will be like an hour, sit beside a beautiful woman for an hour and it will be like a minute, that is relativity. --Albert Einstein
    Linux User #425940

    Don't PM me with questions, instead post in the forums

  4. #4
    Just Joined! Tomato's Avatar
    Join Date
    Aug 2006
    Location
    HKSAR, China
    Posts
    63
    You can remove all the *.exe from current directory and its sub-directories.

    Code:
    find . -name "*.exe" -exec rm "{}" ";"
    I hope it can help you

  5. #5
    Linux Guru Juan Pablo's Avatar
    Join Date
    Mar 2006
    Location
    /home/south_america/ecuador/quito
    Posts
    2,064
    Worked like a perfectly thank you!
    Put your hand in an oven for a minute and it will be like an hour, sit beside a beautiful woman for an hour and it will be like a minute, that is relativity. --Albert Einstein
    Linux User #425940

    Don't PM me with questions, instead post in the forums

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •