Grey Matter

Eternal Sunshine Of A Spotless Mind

Command to find a file pattern and delete it

with 8 comments

If you connect a virus affected pendrive to your linux machine you would see .exe files. Those are the viruses.

Fortunately you can clean the pen drive in Linux and hence use the pen drive back in windows using the following command:

find . -name *.exe | xargs /bin/rm -f


Written by subbu

November 7, 2008 at 3:18 pm

8 Responses

Subscribe to comments with RSS.

  1. can we use this to find Osama and delete him ?? I hope linux wont be affected by Osama

    mean fiasco

    November 12, 2008 at 1:16 pm

  2. @Mean Fiasco

    Osama or Obama ?

    subbu

    November 12, 2008 at 9:46 pm

  3. Are they brothers ?

    mean fiasco

    November 14, 2008 at 2:03 pm

  4. This is not deleting ones with spaces in the filenames.

    Anjanesh

    November 15, 2008 at 5:47 pm

  5. @Anjanesh,

    Yup. thanks for pointing that out

    find . -name *.exe | xargs -0 /bin/rm -f

    this one does delete the files with spaces also.

    subbu

    November 16, 2008 at 7:26 pm

  6. @Mean Fiasco,

    Imagine if Osama states in his next video release that Obama is indeed his man. And this election was his conspiracy.

    subbu

    November 16, 2008 at 7:28 pm

  7. Future : Obama calls a press conference “I am Osama” !!

    Super Future : Obama – “From today, I declare USA as a muslim state”

    Immediate Present : Obama – find . -mean fiasco killhim_heknowstoomuch.exe | xargs -0 /bin/rm -f

    muwhahahaha

    mean fiasco

    November 16, 2008 at 10:38 pm

  8. @Mean Fiasco

    Lol :)

    subbu

    November 22, 2008 at 8:04 pm


Leave a Reply