Find the answer to your Linux question:
Results 1 to 4 of 4
Hi Guys this is something I've tried to do a couple of times, but never with exactly the results I intended. I want to clean out all of the windows ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,133

    Cleaning my iRiver...


    Hi Guys this is something I've tried to do a couple of times, but never with exactly the results I intended. I want to clean out all of the windows crap from my iRiver with a script. Basically I want to scrap files called 'Thumbs.db' and 'Desktop.ini' which could be on any directory level on the player. It's not for any practical reason, I just hate looking at them. It would be nice to pull them out after I lend out my iRiver to a windows buddy too.

    I've used ls scripts, for loops, while, even combinations of ls with grep to find the damn thing. I'm not looking for a script to be written for me, just a few recommendations but I would say if we could stick to BASH I'd appreciate it. I'm only new or quite vague with anything else I've used...

  2. #2
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    There's always find:
    Code:
    find . -name 'Thumbs.db' -exec rm {} \;
    Run from the top level directory and it will recurse them all. Same idea for the other file.

  3. #3
    Linux Guru dylunio's Avatar
    Join Date
    Aug 2004
    Location
    Cymru
    Posts
    4,157
    With what anomie said you might want to make a script like this:
    Code:
    #!/bin/bash
    
    find /mnt/usb/ -name 'Desktop.ini' -exec rm {} \;
    find /mnt/usb/ -name 'Thumbs.db' -exec rm {} \;
    to get rid of the two files you mentioned, though if you want to get rid of all the .db and .ini files use this:
    Code:
    #!/bin/bash
    
    find /mnt/ubs/ -name '*.ini' -exec rm {} \;
    find /mnt/usb/ -name '*.db' -exec rm {} \;
    remember to replace /mnt/usb with the mountpoint for the iRiver.
    Registered Linux User #371543!
    Get force-get May The Source Be With You
    /dev/null
    /dev/null2

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,133
    Thanks guys, I'd gotten so used to locate to find what I was looking for. I only ever used find in the same form as I use the POSIX version that comes with Windows. I have the POSIX tools installed on my XP box at work so I use them a lot there.

    Thanks for the pointer, this looks to be exactly what I'm looking for!

Posting Permissions

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