How to delete specific files? [duplicate]

I'm running Ubuntu 20.04. I have a directory with million of files named like this

master-stdout.log.20210801.024908
master-stdout.log.20210801.025524
master-stdout.log.20210801.064355

How can I delete all of master-stdout.log files?


You can do rm master-stdout.log.* (remember the *)


If you get Argument list too long there is to many files, but there is workarounds...

find . -name "master-stdout.log.*" -print0 | xargs -0 rm

Based on https://stackoverflow.com/a/11289567/2716218