Monday, August 8, 2011

How to remove all *.lnk files from pen drive

Yesterday, I have connected my pen drive on someone else's system. Now, when I return home and connected my pen drive on my system, I have found lnk files for each file and directory in my pendrive. It is a waste of time deleting those files one by one. So, here is a simple command to remove all lnk files.

# find /path/to/pendrive -name '*.lnk' -exec rm -v '{}' ';'

10 comments:

  1. Sounds like "someone else" has a virus...

    Also, with find on Fedora, you should just be able to use -delete.

    ReplyDelete
  2. find /path/to/pendrive -type f -iname '*.lnk' -print0 | xargs -0 rm -vf

    ReplyDelete
  3. find /path/to/pendrive -type f -name '*.lnk' -delete

    ReplyDelete
  4. While searching through net I found that your link Promotional Pens gives a knowledge regarding varities of pens, which is more beneficial in our work.
    Thanx alot for giving such a beneficial information.

    ReplyDelete
  5. Hi I agreed you blog is very good interest to read. By Regards Wholesale Printing And Postcard Printing

    ReplyDelete
  6. sorry it didn"t help me. by-the-way can you just let me know how to get that file which has been defected by virus

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. Nice Post Thanku for Sharing........


    Best Online Computer Technical Support‎ Company 2015


    Delwyn Technologies

    ReplyDelete
  10. Here you can buy best pen dives. PTron Idrive High Speed 16GB 3 in 1 OTG Pen Drive Lightning Micro USB For IOS And Android SmartPhones.

    ReplyDelete