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
Deleting files of a certain file type odt - simply enter the command “rm” followed by an asterisk and the file type.
It means the file is executable.
Use the rm command to remove files you no longer need. The rm command removes the entries for a specified file, group of files, or certain select files from a list within a directory. User confirmation, read permission, and write permission are not required before a file is removed when you use the rm command.
rm -rf \*filter\*
or rm -rf '*filter*'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With