Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using pipes to delete all occurences of Thumbs.db file from Ubuntu Laptop

I have a laptop installed with Ubuntu 10.04. I migrated some of my files from one computer to this computer. But there are some files like Thumbs.db file whose every occurrence I want to get rid of.

I tried using

locate Thumbs.db | rm

But dis didn't worked out (and clearly it should not). Then I tried using following, but quite expectedly none of them worked out :

locate thumbs.db > rm
locate thumbs.db < rm

As everyone here, might have pointed out that I am having a hard time using pipeline and want to just clear my concept using this as an example. I have read the basics but still not able to intitutively able to apply it.

like image 706
w2lame Avatar asked Dec 17 '22 21:12

w2lame


1 Answers

find already has a delete function, so no pipes are necessary:

find . -iname thumbs.db -delete

This says delete all files matching thumbs.db regardless of capitalization, recursively from my current working directory.

like image 194
blee Avatar answered Dec 19 '22 11:12

blee