yosafat yosafat - 1 month ago 17
Bash Question

LINUX How to delete file contains certain name?

I have a file name like this:

filelog20161026


I want delete it using command linux, is it possible using
rmdir
?
it's difficult because the name of file, especially in part date is always change based on datetime.
so, i want to delete where a filename contains filelog name.
is it possible? I'll run the command programatically and I don't know how to confirm it with
y
.

Answer

You can use a glob expression:

$ rm filelog*