Reputation: 27329
How can one in bash delete files whose filename contain asterisks? I mean, using wildcards. If I do
rm -fr *filter*
I will delete all files in which the word "filter" appears in the filename, but what when the files do contain asterisk?
EDIT: Following your advice, I am not able to delete this
*filter*xyz*.data
Upvotes: 5
Views: 6719
Reputation: 5160
rm -rf '*filter*'
Should work well. Use quotes (updated to single based on comment).
Upvotes: 0