View previous topic :: View next topic |
Author |
Message |
mistux Site Admin
Joined: 25 Jun 2004 Posts: 1042 Location: South Bend, Indiana USA
|
Posted: Thu Mar 27, 2008 1:53 pm Post subject: How to delete useless Windows Files in Ubuntu Linux |
|
|
After using Windows for a long time, my music and photos folder where filled with 'desktop.ini' and 'Thumbs.db' files. For a while I've been only using Ubuntu Linux, so I decided to delete those files.
To do it, you may use this command (have in mind that this goes throughout every sub folder in the selected path, so don't do it on the root folder):
Code: | find /my_path -type f -name "desktop.ini" -exec rm -f {} \;
find /my_path -type f -name "Thumbs.db" -exec rm -f {} \; |
We may also use this command to delete album covers in our music folders:
Code: | find /music_path -type f -name "*.jpg" -exec rm -f {} \; |
As you see, this can be used to delete any file (or type of file) recursively in folders. You may use it to delete other files, as long as you take care not to delete files you need or want.
If you want to examine the files that are going to be deleted before doing it, you should execute the same command, changing 'rm' for 'ls', like this:
Quote: | find /my_path -type f -name "desktop.ini" -exec ls -f {} \; |
In this way you may control the list of files to delete.
I hope this helps. |
|
Back to top |
|
|
mistux Site Admin
Joined: 25 Jun 2004 Posts: 1042 Location: South Bend, Indiana USA
|
Posted: Thu Mar 27, 2008 1:54 pm Post subject: |
|
|
or you could use the even shorter version:
Code: | find Music/ -type f -name "Thumbs.db" -delete
or
find Music/ -type f -name "Thumbs.db" -ls |
|
|
Back to top |
|
|
mistux Site Admin
Joined: 25 Jun 2004 Posts: 1042 Location: South Bend, Indiana USA
|
Posted: Thu Mar 27, 2008 3:28 pm Post subject: |
|
|
This shows you how to find all the files:
Code: | find /media/disk/g2data -type f -name "Thumbs_db" |
Can also use wildcard like:
Code: | find /media/disk/g2data -type f -name "Thumbs*" |
|
|
Back to top |
|
|
|