Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to remove all thumbs.db files in a Windows partition using find command in Ubuntu:

find . -iname "*.db"|while read junk;do rm -rfv $junk;done

But it's not working for me and nothing happens! I think I found the problem, the white spaces in directory names!

I did this trick to remove my junk files before on previous version of Ubuntu but now on latest version of Ubuntu I can't.

Is there any bug in my command?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
980 views
Welcome To Ask or Share your Answers For Others

1 Answer

I'd do it this way:

find . -iname 'thumbs.db' -exec rm -rfv {} +

This way, it still works even if your directories contain whitespace in their names.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...