Results 1 to 10 of 16
I am moving over my files from Windows, but Windows keeps packing all these *.ini and *.db files everywhere, and they are just sitting there, cluttering everything up and serving ...
- 08-20-2009 #1Linux Newbie
- Join Date
- Aug 2009
- Posts
- 132
How to delete files in subdirectories?
I am moving over my files from Windows, but Windows keeps packing all these *.ini and *.db files everywhere, and they are just sitting there, cluttering everything up and serving no purpose in Linux.
For example my Pictures folder, wich contains lots of subfolders within subfolders, a lot of them containing those pesky files. I tried:
but it only deleted *.db files that are in the current directory, and the ones in subdirectories are still there. How do I remove all of them without having to manually go through each folder?Code:$ rm -r *.db
- 08-20-2009 #2
this should work, though its not that efficient, open a terminal and cd into your Pictures folder, execute this code
Code:for i in `find . -name "*.db" && find . -name "*.ini"` ; do rm $i ; done
- 08-20-2009 #3
So do you just want to wipe everythig out? Basically nuke it?
Would this work?
rm -rf *.*
Since you probably don't want to sit there saying yes to everything the -f option forces the deletion.
rm -rf *
That could work too, haven't tried it though.
- 08-20-2009 #4
No!
Your first command will delete everything with a . in it's name, the second will delete everything
The original poster only wanted to delete certain filesLinux User #453176
- 08-20-2009 #5
- 08-20-2009 #6Linux Newbie
- Join Date
- Aug 2009
- Posts
- 132
That didn't work.Code:$ rm -rf *.db
Note that I have this alias in my .bashrc file so I wouldn't accidentally delete some important files:
I don't know if that could interfere.Code:alias rm='rm -i'
- 08-20-2009 #7
- 08-20-2009 #8Linux Newbie
- Join Date
- Aug 2009
- Posts
- 132
Still nothing!
- 08-20-2009 #9
did you skip over my post?
- 08-20-2009 #10Linux Newbie
- Join Date
- Aug 2009
- Posts
- 132
It did work, but it seems like there should be an easy way to do it.


Reply With Quote
